UNPKG

3.39 kBSource Map (JSON)View Raw
1{"version":3,"file":"ts-internal.js","sourceRoot":"","sources":["../../src/lib/ts-internal.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AACjC,MAAM,KAAK,GAAG,EAAS,CAAC;AA2BxB,SAAgB,wBAAwB;IACtC,OAAO,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC;AAFD,4DAEC;AAEY,QAAA,kBAAkB,GAAwB,KAAK,CAAC,kBAAkB,CAAC","sourcesContent":["import * as ts from 'typescript';\nconst tsany = ts as any;\n\n/**\n * Expose the internal TypeScript APIs that are used by TypeDoc\n */\ndeclare module 'typescript' {\n interface Symbol {\n // https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L2658\n id?: number;\n // https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L2660\n parent?: ts.Symbol;\n }\n\n interface Node {\n // https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L497\n symbol?: ts.Symbol;\n // https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L500\n localSymbol?: ts.Symbol;\n }\n}\n\n// Everything past here is required for supporting TypeScript's command line options.\n// If TypeDoc dropped support for allowing all of tsc's cli flags, this can all go.\n\n// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/core.ts#L1133-LL1134\nexport function createCompilerDiagnostic(message: ts.DiagnosticMessage, ...args: (string | number)[]): ts.Diagnostic;\nexport function createCompilerDiagnostic(message: ts.DiagnosticMessage): ts.Diagnostic;\nexport function createCompilerDiagnostic() {\n return tsany.createCompilerDiagnostic.apply(this, arguments);\n}\n\nexport const optionDeclarations: CommandLineOption[] = tsany.optionDeclarations;\n\n/**\n * Command line options\n *\n * https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L3310\n */\nexport interface CommandLineOptionBase {\n name: string;\n /**\n * a value of a primitive type, or an object literal mapping named values to actual values\n */\n type: 'string' | 'number' | 'boolean' | 'object' | 'list' | Map<number | string, any>;\n /**\n * True if option value is a path or fileName\n */\n isFilePath?: boolean;\n /**\n * A short mnemonic for convenience - for instance, 'h' can be used in place of 'help'\n */\n shortName?: string;\n /**\n * The message describing what the command line switch does\n */\n description?: ts.DiagnosticMessage;\n /**\n * The name to be used for a non-boolean option's parameter\n */\n paramType?: ts.DiagnosticMessage;\n experimental?: boolean;\n /**\n * True if option can only be specified via tsconfig.json file\n */\n isTSConfigOnly?: boolean;\n}\n\nexport interface CommandLineOptionOfPrimitiveType extends CommandLineOptionBase {\n type: 'string' | 'number' | 'boolean';\n}\n\nexport interface CommandLineOptionOfCustomType extends CommandLineOptionBase {\n type: Map<number | string, any>; // an object literal mapping named values to actual values\n}\n\nexport interface TsConfigOnlyOption extends CommandLineOptionBase {\n type: 'object';\n}\n\nexport interface CommandLineOptionOfListType extends CommandLineOptionBase {\n type: 'list';\n element: CommandLineOptionOfCustomType | CommandLineOptionOfPrimitiveType;\n}\n\nexport type CommandLineOption = CommandLineOptionOfCustomType | CommandLineOptionOfPrimitiveType | TsConfigOnlyOption | CommandLineOptionOfListType;\n"]}
\No newline at end of file