/** * Represents a data structure of JSDoc keywords, like a `@type {string}` */ export interface JSDocKeyword { /** * The name of keyword. * @example for `@param {string} Description of this property`, this field equals a `param`. */ name: string; /** * The description of keyword. * @example for `@param {string} Description of this property`, this field equals a `{string} Description of this property`. */ description: string; } export type JSDocTypeKind = 'type' | 'const' | 'union' | 'function'; export interface JSDocTypeBase { /** * The kind of JSDocType object. * That property can identify which additional properties included in that object. * * @see JSDocTypeElement * @see JSDocTypeConst * @see JSDocTypeUnion * @see JSDocTypeFunction */ kind: JSDocTypeKind; /** * The text representation of this type. */ text: string; } export interface JSDocTypeElement extends JSDocTypeBase { kind: 'type'; /** * The name of JS type. */ type: string; /** * Provide the path from where this event are imported. * Emited only if JSDoc have {import()} statement. * * @example * For example, lets check the following JSDoc comment: * ```js * /** * * @param {import('./typings.d.ts').ImportedObjectType} * *\/ * ``` * Then we got the `./typings.d.ts` value for `importPath` property. */ importPath?: string; } export interface JSDocTypeConst extends JSDocTypeBase { kind: 'const'; /** * The name of JS type. */ type: string; /** * The constant value related to this type, if can be provided. */ value?: any; } export interface JSDocTypeUnion extends JSDocTypeBase { kind: 'union'; /** * The list of possible types. */ type: JSDocType[]; } export interface IMethodDefinition { /** * The list of parameter items of the function expression. */ params?: SvelteMethodParamItem[]; /** * The return item of the function expression. This exists if an item with 'name' equal * to 'returns' or 'return' exists in 'keywords'. */ return?: SvelteMethodReturnItem; } /** * @since {4.2.0} */ export interface JSDocTypeFunction extends JSDocTypeBase, IMethodDefinition { kind: 'function'; } export type JSDocType = JSDocTypeElement | JSDocTypeConst | JSDocTypeUnion | JSDocTypeFunction; /** * Represents a source location of symbol. */ export interface SourceLocation { /** * The symbol start offset from document beginning. */ start: number; /** * The symbol end offset from document beginning. */ end: number; } export type JSVisibilityScope = 'public' | 'protected' | 'private'; export type JSVariableDeclarationKind = 'var' | 'let' | 'const'; export interface IScopedCommentItem { /** * The description of the item, provided from related comment. */ description?: string | null; /** * The visibility of item. */ visibility?: JSVisibilityScope; /** * The list of parsed JSDoc keywords from related comment. */ keywords?: JSDocKeyword[]; } export interface ISvelteItem extends IScopedCommentItem { /** * The name of the item. */ name: string; /** * The list of source code locations for this item. * Provided only if requested by specific option parameter. */ locations?: SourceLocation[]; } export interface SvelteDataBindMapping { /** * The parent component name or DOM element from which are was binded. */ source: string; /** * The name of the property which are was binded. */ property: string; } export interface SvelteDataItem extends ISvelteItem { /** * The JS type of property. */ type?: JSDocType; /** * Kind of variable declaration. * @since Svelte V3 * @since {2.0.0} */ kind?: JSVariableDeclarationKind; /** * Provides information about property binding. * @since Svelte V3 * @since {2.1.0} */ bind?: SvelteDataBindMapping[]; /** * Indicates that this data item of component located in static context. * Variable should be declared in `