diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-05-17 19:50:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 13:50:31 -0400 |
commit | f57aac77ff9ce514730504066daca0a61a959d32 (patch) | |
tree | 34be59895172b93a255c933d0f2e579dbf3a3ccc /cli/dts/lib.deno.unstable.d.ts | |
parent | 9766399a3fefcab322051b4a7af41f9d40d79150 (diff) |
BREAKING: Remove unstable Deno.emit and Deno.formatDiagnostics APIs (#14463)
Diffstat (limited to 'cli/dts/lib.deno.unstable.d.ts')
-rw-r--r-- | cli/dts/lib.deno.unstable.d.ts | 342 |
1 files changed, 0 insertions, 342 deletions
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index ca437bf44..6e9cf7789 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -553,348 +553,6 @@ declare namespace Deno { code: number; } - /** **UNSTABLE**: new API, yet to be vetted. - * - * Format an array of diagnostic items and return them as a single string in a - * user friendly format. If there are no diagnostics then it will return an - * empty string. - * - * ```ts - * const { diagnostics } = await Deno.emit("file_with_compile_issues.ts"); - * console.table(diagnostics); // Prints raw diagnostic data - * console.log(Deno.formatDiagnostics(diagnostics)); // User friendly output of diagnostics - * console.log(Deno.formatDiagnostics([])); // An empty string - * ``` - * - * @param diagnostics An array of diagnostic items to format - */ - export function formatDiagnostics(diagnostics: Diagnostic[]): string; - - /** **UNSTABLE**: new API, yet to be vetted. - * - * A specific subset TypeScript compiler options that can be supported by the - * Deno TypeScript compiler. */ - export interface CompilerOptions { - /** Allow JavaScript files to be compiled. Defaults to `true`. */ - allowJs?: boolean; - /** Allow default imports from modules with no default export. This does not - * affect code emit, just typechecking. Defaults to `false`. */ - allowSyntheticDefaultImports?: boolean; - /** Allow accessing UMD globals from modules. Defaults to `false`. */ - allowUmdGlobalAccess?: boolean; - /** Do not report errors on unreachable code. Defaults to `false`. */ - allowUnreachableCode?: boolean; - /** Do not report errors on unused labels. Defaults to `false` */ - allowUnusedLabels?: boolean; - /** Parse in strict mode and emit `"use strict"` for each source file. - * Defaults to `true`. */ - alwaysStrict?: boolean; - /** Base directory to resolve non-relative module names. Defaults to - * `undefined`. */ - baseUrl?: string; - /** The character set of the input files. Defaults to `"utf8"`. */ - charset?: string; - /** Report errors in `.js` files. Use in conjunction with `allowJs`. Defaults - * to `false`. */ - checkJs?: boolean; - /** Generates corresponding `.d.ts` file. Defaults to `false`. */ - declaration?: boolean; - /** Output directory for generated declaration files. */ - declarationDir?: string; - /** Generates a source map for each corresponding `.d.ts` file. Defaults to - * `false`. */ - declarationMap?: boolean; - /** Provide full support for iterables in `for..of`, spread and - * destructuring when targeting ES5 or ES3. Defaults to `false`. */ - downlevelIteration?: boolean; - /** Only emit `.d.ts` declaration files. Defaults to `false`. */ - emitDeclarationOnly?: boolean; - /** Emit design-type metadata for decorated declarations in source. See issue - * [microsoft/TypeScript#2577](https://github.com/Microsoft/TypeScript/issues/2577) - * for details. Defaults to `false`. */ - emitDecoratorMetadata?: boolean; - /** Emit `__importStar` and `__importDefault` helpers for runtime babel - * ecosystem compatibility and enable `allowSyntheticDefaultImports` for type - * system compatibility. Defaults to `true`. */ - esModuleInterop?: boolean; - /** Enables experimental support for ES decorators. Defaults to `true`. */ - experimentalDecorators?: boolean; - /** Import emit helpers (e.g. `__extends`, `__rest`, etc..) from - * [tslib](https://www.npmjs.com/package/tslib). */ - importHelpers?: boolean; - /** This flag controls how `import` works, there are 3 different options: - * - * - `remove`: The default behavior of dropping import statements which only - * reference types. - * - `preserve`: Preserves all `import` statements whose values or types are - * never used. This can cause imports/side-effects to be preserved. - * - `error`: This preserves all imports (the same as the preserve option), - * but will error when a value import is only used as a type. This might - * be useful if you want to ensure no values are being accidentally - * imported, but still make side-effect imports explicit. - * - * This flag works because you can use `import type` to explicitly create an - * `import` statement which should never be emitted into JavaScript. */ - importsNotUsedAsValues?: "remove" | "preserve" | "error"; - /** Emit a single file with source maps instead of having a separate file. - * Defaults to `false`. */ - inlineSourceMap?: boolean; - /** Emit the source alongside the source maps within a single file; requires - * `inlineSourceMap` or `sourceMap` to be set. Defaults to `false`. */ - inlineSources?: boolean; - /** Support JSX in `.tsx` files: `"react"`, `"preserve"`, `"react-native"`, - * `"react-jsx", `"react-jsxdev"`. - * Defaults to `"react"`. */ - jsx?: "react" | "preserve" | "react-native" | "react-jsx" | "react-jsx-dev"; - /** Specify the JSX factory function to use when targeting react JSX emit, - * e.g. `React.createElement` or `h`. Defaults to `React.createElement`. */ - jsxFactory?: string; - /** Specify the JSX fragment factory function to use when targeting react - * JSX emit, e.g. `Fragment`. Defaults to `React.Fragment`. */ - jsxFragmentFactory?: string; - /** Declares the module specifier to be used for importing the `jsx` and - * `jsxs` factory functions when using jsx as `"react-jsx"` or - * `"react-jsxdev"`. Defaults to `"react"`. */ - jsxImportSource?: string; - /** Resolve keyof to string valued property names only (no numbers or - * symbols). Defaults to `false`. */ - keyofStringsOnly?: string; - /** List of library files to be included in the compilation. If omitted, - * then the Deno main runtime libs are used. */ - lib?: string[]; - /** The locale to use to show error messages. */ - locale?: string; - /** Specifies the location where debugger should locate map files instead of - * generated locations. Use this flag if the `.map` files will be located at - * run-time in a different location than the `.js` files. The location - * specified will be embedded in the source map to direct the debugger where - * the map files will be located. Defaults to `undefined`. */ - mapRoot?: string; - /** Specify the module format for the emitted code. Defaults to - * `"esnext"`. */ - module?: - | "none" - | "commonjs" - | "amd" - | "system" - | "umd" - | "es6" - | "es2015" - | "es2020" - | "esnext"; - /** Do not generate custom helper functions like `__extends` in compiled - * output. Defaults to `false`. */ - noEmitHelpers?: boolean; - /** Report errors for fallthrough cases in switch statement. Defaults to - * `false`. */ - noFallthroughCasesInSwitch?: boolean; - /** Raise error on expressions and declarations with an implied any type. - * Defaults to `true`. */ - noImplicitAny?: boolean; - /** Report an error when not all code paths in function return a value. - * Defaults to `false`. */ - noImplicitReturns?: boolean; - /** Raise error on `this` expressions with an implied `any` type. Defaults to - * `true`. */ - noImplicitThis?: boolean; - /** Do not emit `"use strict"` directives in module output. Defaults to - * `false`. */ - noImplicitUseStrict?: boolean; - /** Do not include the default library file (`lib.d.ts`). Defaults to - * `false`. */ - noLib?: boolean; - /** Do not add triple-slash references or module import targets to the list of - * compiled files. Defaults to `false`. */ - noResolve?: boolean; - /** Disable strict checking of generic signatures in function types. Defaults - * to `false`. */ - noStrictGenericChecks?: boolean; - /** Include 'undefined' in index signature results. Defaults to `false`. */ - noUncheckedIndexedAccess?: boolean; - /** Report errors on unused locals. Defaults to `false`. */ - noUnusedLocals?: boolean; - /** Report errors on unused parameters. Defaults to `false`. */ - noUnusedParameters?: boolean; - /** List of path mapping entries for module names to locations relative to the - * `baseUrl`. Defaults to `undefined`. */ - paths?: Record<string, string[]>; - /** Do not erase const enum declarations in generated code. Defaults to - * `false`. */ - preserveConstEnums?: boolean; - /** Remove all comments except copy-right header comments beginning with - * `/*!`. Defaults to `true`. */ - removeComments?: boolean; - /** Specifies the root directory of input files. Only use to control the - * output directory structure with `outDir`. Defaults to `undefined`. */ - rootDir?: string; - /** List of _root_ folders whose combined content represent the structure of - * the project at runtime. Defaults to `undefined`. */ - rootDirs?: string[]; - /** Generates corresponding `.map` file. Defaults to `false`. */ - sourceMap?: boolean; - /** Specifies the location where debugger should locate TypeScript files - * instead of source locations. Use this flag if the sources will be located - * at run-time in a different location than that at design-time. The location - * specified will be embedded in the sourceMap to direct the debugger where - * the source files will be located. Defaults to `undefined`. */ - sourceRoot?: string; - /** Skip type checking of all declaration files (`*.d.ts`). */ - skipLibCheck?: boolean; - /** Enable all strict type checking options. Enabling `strict` enables - * `noImplicitAny`, `noImplicitThis`, `alwaysStrict`, `strictBindCallApply`, - * `strictNullChecks`, `strictFunctionTypes` and - * `strictPropertyInitialization`. Defaults to `true`. */ - strict?: boolean; - /** Enable stricter checking of the `bind`, `call`, and `apply` methods on - * functions. Defaults to `true`. */ - strictBindCallApply?: boolean; - /** Disable bivariant parameter checking for function types. Defaults to - * `true`. */ - strictFunctionTypes?: boolean; - /** Ensure non-undefined class properties are initialized in the constructor. - * This option requires `strictNullChecks` be enabled in order to take effect. - * Defaults to `true`. */ - strictPropertyInitialization?: boolean; - /** In strict null checking mode, the `null` and `undefined` values are not in - * the domain of every type and are only assignable to themselves and `any` - * (the one exception being that `undefined` is also assignable to `void`). */ - strictNullChecks?: boolean; - /** Suppress excess property checks for object literals. Defaults to - * `false`. */ - suppressExcessPropertyErrors?: boolean; - /** Suppress `noImplicitAny` errors for indexing objects lacking index - * signatures. */ - suppressImplicitAnyIndexErrors?: boolean; - /** Specify ECMAScript target version. Defaults to `esnext`. */ - target?: - | "es3" - | "es5" - | "es6" - | "es2015" - | "es2016" - | "es2017" - | "es2018" - | "es2019" - | "es2020" - | "esnext"; - /** List of names of type definitions to include when type checking. - * Defaults to `undefined`. - * - * The type definitions are resolved according to the normal Deno resolution - * irrespective of if sources are provided on the call. In addition, unlike - * passing the `--config` option on startup, there is no base to resolve - * relative specifiers, so the specifiers here have to be fully qualified - * URLs or paths. For example: - * - * ```ts - * Deno.emit("./a.ts", { - * compilerOptions: { - * types: [ - * "https://deno.land/x/pkg/types.d.ts", - * "/Users/me/pkg/types.d.ts", - * ] - * } - * }); - * ``` - */ - types?: string[]; - /** Emit class fields with ECMAScript-standard semantics. Defaults to - * `false`. */ - useDefineForClassFields?: boolean; - } - - interface ImportMap { - imports: Record<string, string>; - scopes?: Record<string, Record<string, string>>; - } - - /** - * **UNSTABLE**: new API, yet to be vetted. - * - * The options for `Deno.emit()` API. - */ - export interface EmitOptions { - /** Indicate that the source code should be emitted to a single file - * JavaScript bundle that is a single ES module (`"module"`) or a single - * file self contained script executed in an immediately invoked function - * when loaded (`"classic"`). */ - bundle?: "module" | "classic"; - /** If `true` then the sources will be typed checked, returning any - * diagnostic errors in the result. If `false` type checking will be - * skipped. Defaults to `true`. - * - * *Note* by default, only TypeScript will be type checked, just like on - * the command line. Use the `compilerOptions` options of `checkJs` to - * enable type checking of JavaScript. */ - check?: boolean; - /** A set of options that are aligned to TypeScript compiler options that - * are supported by Deno. */ - compilerOptions?: CompilerOptions; - /** An [import-map](https://deno.land/manual/linking_to_external_code/import_maps#import-maps) - * which will be applied to the imports. */ - importMap?: ImportMap; - /** An absolute path to an [import-map](https://deno.land/manual/linking_to_external_code/import_maps#import-maps). - * Required to be specified if an `importMap` is specified to be able to - * determine resolution of relative paths. If a `importMap` is not - * specified, then it will assumed the file path points to an import map on - * disk and will be attempted to be loaded based on current runtime - * permissions. - */ - importMapPath?: string; - /** A record of sources to use when doing the emit. If provided, Deno will - * use these sources instead of trying to resolve the modules externally. */ - sources?: Record<string, string>; - } - - /** - * **UNSTABLE**: new API, yet to be vetted. - * - * The result of `Deno.emit()` API. - */ - export interface EmitResult { - /** Diagnostic messages returned from the type checker (`tsc`). - * - * Can be used with `Deno.formatDiagnostics` to display a user - * friendly string. */ - diagnostics: Diagnostic[]; - /** Any emitted files. If bundled, then the JavaScript will have the - * key of `deno:///bundle.js` with an optional map (based on - * `compilerOptions`) in `deno:///bundle.js.map`. */ - files: Record<string, string>; - /** An optional array of any compiler options that were ignored by Deno. */ - ignoredOptions?: string[]; - /** An array of internal statistics related to the emit, for diagnostic - * purposes. */ - stats: Array<[string, number]>; - } - - /** - * **UNSTABLE**: new API, yet to be vetted. - * - * Similar to the command line functionality of `deno run` or `deno cache`, - * `Deno.emit()` provides a way to provide Deno arbitrary JavaScript - * or TypeScript and have it return JavaScript based on the options and - * settings provided. The source code can either be provided or the modules - * can be fetched and resolved in line with the behavior of the command line. - * - * Requires `allow-read` and/or `allow-net` if sources are not provided. - * - * @param rootSpecifier The specifier that will be used as the entry point. - * If no sources are provided, then the specifier would - * be the same as if you typed it on the command line for - * `deno run`. If sources are provided, it should match - * one of the names of the sources. - * @param options A set of options to be used with the emit. - * - * @returns The result of the emit. If diagnostics are found, they can be used - * with `Deno.formatDiagnostics` to construct a user friendly string, which - * has the same format as CLI diagnostics. - */ - export function emit( - rootSpecifier: string | URL, - options?: EmitOptions, - ): Promise<EmitResult>; - export type SetRawOptions = { cbreak: boolean; }; |