import type { ApiClassCallSignature, ApiClassConstructor, ApiClassDeclaration, ApiClassField, ApiClassMethod, ApiCustomElementDeclaration, ApiFunctionDeclaration, ApiInterfaceDeclaration, ApiMixinDeclaration, ApiModule, ApiVariableDeclaration } from "../apiJson.js"; export interface ApiDiff { modules: ApiModuleDiff[]; } export interface ApiModuleDiff { path: ApiModule["path"]; declarations: ApiDeclarationDiff[]; } export interface ApiDiffBase { name: string; /** * True if this declaration was removed in the new api.json. * If class is removed, members are not listed. * * @default false */ removed?: true; /** * True if this declaration was added in the new api.json. * If class is added, members are not listed. * * @default false */ added?: true; /** * Whether this declaration is deprecated in the new api.json. If declaration * was removed, but was deprecated in the old api.json, this will show the old * deprecation message as it points at the replacement API. * If the value is a string, it's the reason for the deprecation. * Deprecated takes precedence over added. * * @default false */ deprecated?: boolean | string; } export type ApiDeclarationDiff = ApiClassDeclarationDiff | ApiCustomElementDeclarationDiff | ApiFunctionDeclarationDiff | ApiInterfaceDeclarationDiff | ApiMixinDeclarationDiff | ApiVariableDeclarationDiff; export interface ApiClassDeclarationDiff extends ApiDiffBase { kind: ApiClassDeclaration["kind"]; /** * Inherited members are not included in the diff. * Also, if entire class is added/removed, members are not included in the diff. */ members?: ApiClassMemberDiff[]; events?: ApiDiffBase[]; } export interface ApiInterfaceDeclarationDiff extends ApiDiffBase { kind: ApiInterfaceDeclaration["kind"]; /** * Inherited members are not included in the diff. * Also, if entire class is added/removed, members are not included in the diff. */ members?: ApiClassMemberDiff[]; } export interface ApiMixinDeclarationDiff extends Omit { kind: ApiMixinDeclaration["kind"]; } export interface ApiCustomElementDeclarationDiff extends ApiClassDeclarationDiff { /** Attributes diff is not included as attributes are based on members. */ tagName: ApiCustomElementDeclaration["tagName"]; slots?: ApiDiffBase[]; cssParts?: ApiDiffBase[]; cssProperties?: ApiDiffBase[]; cssStates?: ApiDiffBase[]; } export type ApiClassMemberDiff = ApiClassCallSignatureDiff | ApiClassConstructorDiff | ApiClassFieldDiff | ApiClassMethodDiff; export interface ApiClassFieldDiff extends ApiDiffBase { kind: ApiClassField["kind"]; } export interface ApiClassMethodDiff extends ApiDiffBase { kind: ApiClassMethod["kind"]; } export interface ApiClassConstructorDiff extends Omit { kind: ApiClassConstructor["kind"]; } export interface ApiClassCallSignatureDiff extends Omit { kind: ApiClassCallSignature["kind"]; } export interface ApiFunctionDeclarationDiff extends ApiDiffBase { kind: ApiFunctionDeclaration["kind"]; } export interface ApiVariableDeclarationDiff extends ApiDiffBase { kind: ApiVariableDeclaration["kind"]; }