chore: wipe legacy codebase for complete project restart
This commit is contained in:
1 parent
a90af21a8c
commit
e94410f388
11161 files changed
+1628844
-2097
No files matched your search
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/babel__core`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for @babel/core (https://github.com/babel/babel/tree/master/packages/babel-core).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__core.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 20 Nov 2023 23:36:23 GMT
|
||||
* Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types), [@types/babel__generator](https://npmjs.com/package/@types/babel__generator), [@types/babel__template](https://npmjs.com/package/@types/babel__template), [@types/babel__traverse](https://npmjs.com/package/@types/babel__traverse)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), [Jessica Franco](https://github.com/Jessidhia), and [Ifiok Jr.](https://github.com/ifiokjr).
|
||||
+831
@@ -0,0 +1,831 @@
|
||||
import { GeneratorOptions } from "@babel/generator";
|
||||
import { ParserOptions } from "@babel/parser";
|
||||
import template from "@babel/template";
|
||||
import traverse, { Hub, NodePath, Scope, Visitor } from "@babel/traverse";
|
||||
import * as t from "@babel/types";
|
||||
|
||||
export { GeneratorOptions, NodePath, ParserOptions, t as types, template, traverse, Visitor };
|
||||
|
||||
export type Node = t.Node;
|
||||
export type ParseResult = ReturnType<typeof import("@babel/parser").parse>;
|
||||
export const version: string;
|
||||
export const DEFAULT_EXTENSIONS: [".js", ".jsx", ".es6", ".es", ".mjs"];
|
||||
|
||||
/**
|
||||
* Source map standard format as to revision 3
|
||||
* @see {@link https://sourcemaps.info/spec.html}
|
||||
* @see {@link https://github.com/mozilla/source-map/blob/HEAD/source-map.d.ts}
|
||||
*/
|
||||
interface InputSourceMap {
|
||||
version: number;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourceRoot?: string | undefined;
|
||||
sourcesContent?: string[] | undefined;
|
||||
mappings: string;
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface TransformOptions {
|
||||
/**
|
||||
* Specify which assumptions it can make about your code, to better optimize the compilation result. **NOTE**: This replaces the various `loose` options in plugins in favor of
|
||||
* top-level options that can apply to multiple plugins
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/assumptions
|
||||
*/
|
||||
assumptions?: { [name: string]: boolean } | null | undefined;
|
||||
|
||||
/**
|
||||
* Include the AST in the returned object
|
||||
*
|
||||
* Default: `false`
|
||||
*/
|
||||
ast?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Attach a comment after all non-user injected code
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
auxiliaryCommentAfter?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* Attach a comment before all non-user injected code
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
auxiliaryCommentBefore?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* Specify the "root" folder that defines the location to search for "babel.config.js", and the default folder to allow `.babelrc` files inside of.
|
||||
*
|
||||
* Default: `"."`
|
||||
*/
|
||||
root?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* This option, combined with the "root" value, defines how Babel chooses its project root.
|
||||
* The different modes define different ways that Babel can process the "root" value to get
|
||||
* the final project root.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/options#rootmode
|
||||
*/
|
||||
rootMode?: "root" | "upward" | "upward-optional" | undefined;
|
||||
|
||||
/**
|
||||
* The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files.
|
||||
*
|
||||
* Default: `undefined`
|
||||
*/
|
||||
configFile?: string | boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Specify whether or not to use .babelrc and
|
||||
* .babelignore files.
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
babelrc?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Specify which packages should be search for .babelrc files when they are being compiled. `true` to always search, or a path string or an array of paths to packages to search
|
||||
* inside of. Defaults to only searching the "root" package.
|
||||
*
|
||||
* Default: `(root)`
|
||||
*/
|
||||
babelrcRoots?: boolean | MatchPattern | MatchPattern[] | null | undefined;
|
||||
|
||||
/**
|
||||
* Toggles whether or not browserslist config sources are used, which includes searching for any browserslist files or referencing the browserslist key inside package.json.
|
||||
* This is useful for projects that use a browserslist config for files that won't be compiled with Babel.
|
||||
*
|
||||
* If a string is specified, it must represent the path of a browserslist configuration file. Relative paths are resolved relative to the configuration file which specifies
|
||||
* this option, or to `cwd` when it's passed as part of the programmatic options.
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
browserslistConfigFile?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* The Browserslist environment to use.
|
||||
*
|
||||
* Default: `undefined`
|
||||
*/
|
||||
browserslistEnv?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* By default `babel.transformFromAst` will clone the input AST to avoid mutations.
|
||||
* Specifying `cloneInputAst: false` can improve parsing performance if the input AST is not used elsewhere.
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
cloneInputAst?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Defaults to environment variable `BABEL_ENV` if set, or else `NODE_ENV` if set, or else it defaults to `"development"`
|
||||
*
|
||||
* Default: env vars
|
||||
*/
|
||||
envName?: string | undefined;
|
||||
|
||||
/**
|
||||
* If any of patterns match, the current configuration object is considered inactive and is ignored during config processing.
|
||||
*/
|
||||
exclude?: MatchPattern | MatchPattern[] | undefined;
|
||||
|
||||
/**
|
||||
* Enable code generation
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
code?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Output comments in generated output
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
comments?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Do not include superfluous whitespace characters and line terminators. When set to `"auto"` compact is set to `true` on input sizes of >500KB
|
||||
*
|
||||
* Default: `"auto"`
|
||||
*/
|
||||
compact?: boolean | "auto" | null | undefined;
|
||||
|
||||
/**
|
||||
* The working directory that Babel's programmatic options are loaded relative to.
|
||||
*
|
||||
* Default: `"."`
|
||||
*/
|
||||
cwd?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* Utilities may pass a caller object to identify themselves to Babel and
|
||||
* pass capability-related flags for use by configs, presets and plugins.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/options#caller
|
||||
*/
|
||||
caller?: TransformCaller | undefined;
|
||||
|
||||
/**
|
||||
* This is an object of keys that represent different environments. For example, you may have: `{ env: { production: { \/* specific options *\/ } } }`
|
||||
* which will use those options when the `envName` is `production`
|
||||
*
|
||||
* Default: `{}`
|
||||
*/
|
||||
env?: { [index: string]: TransformOptions | null | undefined } | null | undefined;
|
||||
|
||||
/**
|
||||
* A path to a `.babelrc` file to extend
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
extends?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* Filename for use in errors etc
|
||||
*
|
||||
* Default: `"unknown"`
|
||||
*/
|
||||
filename?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* Filename relative to `sourceRoot`
|
||||
*
|
||||
* Default: `(filename)`
|
||||
*/
|
||||
filenameRelative?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* An object containing the options to be passed down to the babel code generator, @babel/generator
|
||||
*
|
||||
* Default: `{}`
|
||||
*/
|
||||
generatorOpts?: GeneratorOptions | null | undefined;
|
||||
|
||||
/**
|
||||
* Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`. If falsy value is returned then the generated module id is used
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
getModuleId?: ((moduleName: string) => string | null | undefined) | null | undefined;
|
||||
|
||||
/**
|
||||
* ANSI highlight syntax error code frames
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
highlightCode?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Opposite to the `only` option. `ignore` is disregarded if `only` is specified
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
ignore?: MatchPattern[] | null | undefined;
|
||||
|
||||
/**
|
||||
* This option is a synonym for "test"
|
||||
*/
|
||||
include?: MatchPattern | MatchPattern[] | undefined;
|
||||
|
||||
/**
|
||||
* A source map object that the output source map will be based on
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
inputSourceMap?: InputSourceMap | null | undefined;
|
||||
|
||||
/**
|
||||
* Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping `()` from `new` when safe)
|
||||
*
|
||||
* Default: `false`
|
||||
*/
|
||||
minified?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Specify a custom name for module ids
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
moduleId?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for `common` modules)
|
||||
*
|
||||
* Default: `false`
|
||||
*/
|
||||
moduleIds?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions
|
||||
*
|
||||
* Default: `(sourceRoot)`
|
||||
*/
|
||||
moduleRoot?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* A glob, regex, or mixed array of both, matching paths to **only** compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile
|
||||
* a non-matching file it's returned verbatim
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
only?: MatchPattern[] | null | undefined;
|
||||
|
||||
/**
|
||||
* Allows users to provide an array of options that will be merged into the current configuration one at a time.
|
||||
* This feature is best used alongside the "test"/"include"/"exclude" options to provide conditions for which an override should apply
|
||||
*/
|
||||
overrides?: TransformOptions[] | undefined;
|
||||
|
||||
/**
|
||||
* An object containing the options to be passed down to the babel parser, @babel/parser
|
||||
*
|
||||
* Default: `{}`
|
||||
*/
|
||||
parserOpts?: ParserOptions | null | undefined;
|
||||
|
||||
/**
|
||||
* List of plugins to load and use
|
||||
*
|
||||
* Default: `[]`
|
||||
*/
|
||||
plugins?: PluginItem[] | null | undefined;
|
||||
|
||||
/**
|
||||
* List of presets (a set of plugins) to load and use
|
||||
*
|
||||
* Default: `[]`
|
||||
*/
|
||||
presets?: PluginItem[] | null | undefined;
|
||||
|
||||
/**
|
||||
* Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (**NOTE**: This will not retain the columns)
|
||||
*
|
||||
* Default: `false`
|
||||
*/
|
||||
retainLines?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comment` option when used
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
shouldPrintComment?: ((commentContents: string) => boolean) | null | undefined;
|
||||
|
||||
/**
|
||||
* Set `sources[0]` on returned source map
|
||||
*
|
||||
* Default: `(filenameRelative)`
|
||||
*/
|
||||
sourceFileName?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to `"both"`
|
||||
* then a `map` property is returned as well as a source map comment appended. **This does not emit sourcemap files by itself!**
|
||||
*
|
||||
* Default: `false`
|
||||
*/
|
||||
sourceMaps?: boolean | "inline" | "both" | null | undefined;
|
||||
|
||||
/**
|
||||
* The root from which all sources are relative
|
||||
*
|
||||
* Default: `(moduleRoot)`
|
||||
*/
|
||||
sourceRoot?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". `"unambiguous"` will make Babel attempt to guess, based on the presence of ES6
|
||||
* `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`.
|
||||
*
|
||||
* Default: `("module")`
|
||||
*/
|
||||
sourceType?: "script" | "module" | "unambiguous" | null | undefined;
|
||||
|
||||
/**
|
||||
* If all patterns fail to match, the current configuration object is considered inactive and is ignored during config processing.
|
||||
*/
|
||||
test?: MatchPattern | MatchPattern[] | undefined;
|
||||
|
||||
/**
|
||||
* Describes the environments you support/target for your project.
|
||||
* This can either be a [browserslist-compatible](https://github.com/ai/browserslist) query (with [caveats](https://babeljs.io/docs/en/babel-preset-env#ineffective-browserslist-queries))
|
||||
*
|
||||
* Default: `{}`
|
||||
*/
|
||||
targets?:
|
||||
| string
|
||||
| string[]
|
||||
| {
|
||||
esmodules?: boolean;
|
||||
node?: Omit<string, "current"> | "current" | true;
|
||||
safari?: Omit<string, "tp"> | "tp";
|
||||
browsers?: string | string[];
|
||||
android?: string;
|
||||
chrome?: string;
|
||||
deno?: string;
|
||||
edge?: string;
|
||||
electron?: string;
|
||||
firefox?: string;
|
||||
ie?: string;
|
||||
ios?: string;
|
||||
opera?: string;
|
||||
rhino?: string;
|
||||
samsung?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* An optional callback that can be used to wrap visitor methods. **NOTE**: This is useful for things like introspection, and not really needed for implementing anything. Called as
|
||||
* `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`.
|
||||
*/
|
||||
wrapPluginVisitorMethod?:
|
||||
| ((
|
||||
pluginAlias: string,
|
||||
visitorType: "enter" | "exit",
|
||||
callback: (path: NodePath, state: any) => void,
|
||||
) => (path: NodePath, state: any) => void)
|
||||
| null
|
||||
| undefined;
|
||||
}
|
||||
|
||||
export interface TransformCaller {
|
||||
// the only required property
|
||||
name: string;
|
||||
// e.g. set to true by `babel-loader` and false by `babel-jest`
|
||||
supportsStaticESM?: boolean | undefined;
|
||||
supportsDynamicImport?: boolean | undefined;
|
||||
supportsExportNamespaceFrom?: boolean | undefined;
|
||||
supportsTopLevelAwait?: boolean | undefined;
|
||||
// augment this with a "declare module '@babel/core' { ... }" if you need more keys
|
||||
}
|
||||
|
||||
export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any;
|
||||
|
||||
export interface MatchPatternContext {
|
||||
envName: string;
|
||||
dirname: string;
|
||||
caller: TransformCaller | undefined;
|
||||
}
|
||||
export type MatchPattern = string | RegExp | ((filename: string | undefined, context: MatchPatternContext) => boolean);
|
||||
|
||||
/**
|
||||
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
||||
*/
|
||||
export function transform(code: string, callback: FileResultCallback): void;
|
||||
|
||||
/**
|
||||
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
||||
*/
|
||||
export function transform(code: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
||||
|
||||
/**
|
||||
* Here for backward-compatibility. Ideally use `transformSync` if you want a synchronous API.
|
||||
*/
|
||||
export function transform(code: string, opts?: TransformOptions): BabelFileResult | null;
|
||||
|
||||
/**
|
||||
* Transforms the passed in code. Returning an object with the generated code, source map, and AST.
|
||||
*/
|
||||
export function transformSync(code: string, opts?: TransformOptions): BabelFileResult | null;
|
||||
|
||||
/**
|
||||
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
||||
*/
|
||||
export function transformAsync(code: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
||||
|
||||
/**
|
||||
* Asynchronously transforms the entire contents of a file.
|
||||
*/
|
||||
export function transformFile(filename: string, callback: FileResultCallback): void;
|
||||
|
||||
/**
|
||||
* Asynchronously transforms the entire contents of a file.
|
||||
*/
|
||||
export function transformFile(filename: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
||||
|
||||
/**
|
||||
* Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`.
|
||||
*/
|
||||
export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult | null;
|
||||
|
||||
/**
|
||||
* Asynchronously transforms the entire contents of a file.
|
||||
*/
|
||||
export function transformFileAsync(filename: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
||||
|
||||
/**
|
||||
* Given an AST, transform it.
|
||||
*/
|
||||
export function transformFromAst(ast: Node, code: string | undefined, callback: FileResultCallback): void;
|
||||
|
||||
/**
|
||||
* Given an AST, transform it.
|
||||
*/
|
||||
export function transformFromAst(
|
||||
ast: Node,
|
||||
code: string | undefined,
|
||||
opts: TransformOptions | undefined,
|
||||
callback: FileResultCallback,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Here for backward-compatibility. Ideally use ".transformSync" if you want a synchronous API.
|
||||
*/
|
||||
export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult | null;
|
||||
|
||||
/**
|
||||
* Given an AST, transform it.
|
||||
*/
|
||||
export function transformFromAstAsync(
|
||||
ast: Node,
|
||||
code?: string,
|
||||
opts?: TransformOptions,
|
||||
): Promise<BabelFileResult | null>;
|
||||
|
||||
// A babel plugin is a simple function which must return an object matching
|
||||
// the following interface. Babel will throw if it finds unknown properties.
|
||||
// The list of allowed plugin keys is here:
|
||||
// https://github.com/babel/babel/blob/4e50b2d9d9c376cee7a2cbf56553fe5b982ea53c/packages/babel-core/src/config/option-manager.js#L71
|
||||
export interface PluginObj<S = PluginPass> {
|
||||
name?: string | undefined;
|
||||
manipulateOptions?(opts: any, parserOpts: any): void;
|
||||
pre?(this: S, file: BabelFile): void;
|
||||
visitor: Visitor<S>;
|
||||
post?(this: S, file: BabelFile): void;
|
||||
inherits?: any;
|
||||
}
|
||||
|
||||
export interface BabelFile {
|
||||
ast: t.File;
|
||||
opts: TransformOptions;
|
||||
hub: Hub;
|
||||
metadata: object;
|
||||
path: NodePath<t.Program>;
|
||||
scope: Scope;
|
||||
inputMap: object | null;
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface PluginPass {
|
||||
file: BabelFile;
|
||||
key: string;
|
||||
opts: object;
|
||||
cwd: string;
|
||||
filename: string | undefined;
|
||||
get(key: unknown): any;
|
||||
set(key: unknown, value: unknown): void;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface BabelFileResult {
|
||||
ast?: t.File | null | undefined;
|
||||
code?: string | null | undefined;
|
||||
ignored?: boolean | undefined;
|
||||
map?:
|
||||
| {
|
||||
version: number;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourceRoot?: string | undefined;
|
||||
sourcesContent?: string[] | undefined;
|
||||
mappings: string;
|
||||
file: string;
|
||||
}
|
||||
| null
|
||||
| undefined;
|
||||
metadata?: BabelFileMetadata | undefined;
|
||||
}
|
||||
|
||||
export interface BabelFileMetadata {
|
||||
usedHelpers: string[];
|
||||
marked: Array<{
|
||||
type: string;
|
||||
message: string;
|
||||
loc: object;
|
||||
}>;
|
||||
modules: BabelFileModulesMetadata;
|
||||
}
|
||||
|
||||
export interface BabelFileModulesMetadata {
|
||||
imports: object[];
|
||||
exports: {
|
||||
exported: object[];
|
||||
specifiers: object[];
|
||||
};
|
||||
}
|
||||
|
||||
export type FileParseCallback = (err: Error | null, result: ParseResult | null) => any;
|
||||
|
||||
/**
|
||||
* Given some code, parse it using Babel's standard behavior.
|
||||
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
||||
*/
|
||||
export function parse(code: string, callback: FileParseCallback): void;
|
||||
|
||||
/**
|
||||
* Given some code, parse it using Babel's standard behavior.
|
||||
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
||||
*/
|
||||
export function parse(code: string, options: TransformOptions | undefined, callback: FileParseCallback): void;
|
||||
|
||||
/**
|
||||
* Given some code, parse it using Babel's standard behavior.
|
||||
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
||||
*/
|
||||
export function parse(code: string, options?: TransformOptions): ParseResult | null;
|
||||
|
||||
/**
|
||||
* Given some code, parse it using Babel's standard behavior.
|
||||
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
||||
*/
|
||||
export function parseSync(code: string, options?: TransformOptions): ParseResult | null;
|
||||
|
||||
/**
|
||||
* Given some code, parse it using Babel's standard behavior.
|
||||
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
||||
*/
|
||||
export function parseAsync(code: string, options?: TransformOptions): Promise<ParseResult | null>;
|
||||
|
||||
/**
|
||||
* Resolve Babel's options fully, resulting in an options object where:
|
||||
*
|
||||
* * opts.plugins is a full list of Plugin instances.
|
||||
* * opts.presets is empty and all presets are flattened into opts.
|
||||
* * It can be safely passed back to Babel. Fields like babelrc have been set to false so that later calls to Babel
|
||||
* will not make a second attempt to load config files.
|
||||
*
|
||||
* Plugin instances aren't meant to be manipulated directly, but often callers will serialize this opts to JSON to
|
||||
* use it as a cache key representing the options Babel has received. Caching on this isn't 100% guaranteed to
|
||||
* invalidate properly, but it is the best we have at the moment.
|
||||
*/
|
||||
export function loadOptions(options?: TransformOptions): object | null;
|
||||
|
||||
/**
|
||||
* To allow systems to easily manipulate and validate a user's config, this function resolves the plugins and
|
||||
* presets and proceeds no further. The expectation is that callers will take the config's .options, manipulate it
|
||||
* as then see fit and pass it back to Babel again.
|
||||
*
|
||||
* * `babelrc: string | void` - The path of the `.babelrc` file, if there was one.
|
||||
* * `babelignore: string | void` - The path of the `.babelignore` file, if there was one.
|
||||
* * `options: ValidatedOptions` - The partially resolved options, which can be manipulated and passed back
|
||||
* to Babel again.
|
||||
* * `plugins: Array<ConfigItem>` - See below.
|
||||
* * `presets: Array<ConfigItem>` - See below.
|
||||
* * It can be safely passed back to Babel. Fields like `babelrc` have been set to false so that later calls to
|
||||
* Babel will not make a second attempt to load config files.
|
||||
*
|
||||
* `ConfigItem` instances expose properties to introspect the values, but each item should be treated as
|
||||
* immutable. If changes are desired, the item should be removed from the list and replaced with either a normal
|
||||
* Babel config value, or with a replacement item created by `babel.createConfigItem`. See that function for
|
||||
* information about `ConfigItem` fields.
|
||||
*/
|
||||
export function loadPartialConfig(options?: TransformOptions): Readonly<PartialConfig> | null;
|
||||
export function loadPartialConfigAsync(options?: TransformOptions): Promise<Readonly<PartialConfig> | null>;
|
||||
|
||||
export interface PartialConfig {
|
||||
options: TransformOptions;
|
||||
babelrc?: string | undefined;
|
||||
babelignore?: string | undefined;
|
||||
config?: string | undefined;
|
||||
hasFilesystemConfig: () => boolean;
|
||||
}
|
||||
|
||||
export interface ConfigItem {
|
||||
/**
|
||||
* The name that the user gave the plugin instance, e.g. `plugins: [ ['env', {}, 'my-env'] ]`
|
||||
*/
|
||||
name?: string | undefined;
|
||||
|
||||
/**
|
||||
* The resolved value of the plugin.
|
||||
*/
|
||||
value: object | ((...args: any[]) => any);
|
||||
|
||||
/**
|
||||
* The options object passed to the plugin.
|
||||
*/
|
||||
options?: object | false | undefined;
|
||||
|
||||
/**
|
||||
* The path that the options are relative to.
|
||||
*/
|
||||
dirname: string;
|
||||
|
||||
/**
|
||||
* Information about the plugin's file, if Babel knows it.
|
||||
* *
|
||||
*/
|
||||
file?:
|
||||
| {
|
||||
/**
|
||||
* The file that the user requested, e.g. `"@babel/env"`
|
||||
*/
|
||||
request: string;
|
||||
|
||||
/**
|
||||
* The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"`
|
||||
*/
|
||||
resolved: string;
|
||||
}
|
||||
| null
|
||||
| undefined;
|
||||
}
|
||||
|
||||
export type PluginOptions = object | undefined | false;
|
||||
|
||||
export type PluginTarget = string | object | ((...args: any[]) => any);
|
||||
|
||||
export type PluginItem =
|
||||
| ConfigItem
|
||||
| PluginObj<any>
|
||||
| PluginTarget
|
||||
| [PluginTarget, PluginOptions]
|
||||
| [PluginTarget, PluginOptions, string | undefined];
|
||||
|
||||
export function resolvePlugin(name: string, dirname: string): string | null;
|
||||
export function resolvePreset(name: string, dirname: string): string | null;
|
||||
|
||||
export interface CreateConfigItemOptions {
|
||||
dirname?: string | undefined;
|
||||
type?: "preset" | "plugin" | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows build tooling to create and cache config items up front. If this function is called multiple times for a
|
||||
* given plugin, Babel will call the plugin's function itself multiple times. If you have a clear set of expected
|
||||
* plugins and presets to inject, pre-constructing the config items would be recommended.
|
||||
*/
|
||||
export function createConfigItem(
|
||||
value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined],
|
||||
options?: CreateConfigItemOptions,
|
||||
): ConfigItem;
|
||||
|
||||
// NOTE: the documentation says the ConfigAPI also exposes @babel/core's exports, but it actually doesn't
|
||||
/**
|
||||
* @see https://babeljs.io/docs/en/next/config-files#config-function-api
|
||||
*/
|
||||
export interface ConfigAPI {
|
||||
/**
|
||||
* The version string for the Babel version that is loading the config file.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apiversion
|
||||
*/
|
||||
version: string;
|
||||
/**
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apicache
|
||||
*/
|
||||
cache: SimpleCacheConfigurator;
|
||||
/**
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apienv
|
||||
*/
|
||||
env: EnvFunction;
|
||||
// undocumented; currently hardcoded to return 'false'
|
||||
// async(): boolean
|
||||
/**
|
||||
* This API is used as a way to access the `caller` data that has been passed to Babel.
|
||||
* Since many instances of Babel may be running in the same process with different `caller` values,
|
||||
* this API is designed to automatically configure `api.cache`, the same way `api.env()` does.
|
||||
*
|
||||
* The `caller` value is available as the first parameter of the callback function.
|
||||
* It is best used with something like this to toggle configuration behavior
|
||||
* based on a specific environment:
|
||||
*
|
||||
* @example
|
||||
* function isBabelRegister(caller?: { name: string }) {
|
||||
* return !!(caller && caller.name === "@babel/register")
|
||||
* }
|
||||
* api.caller(isBabelRegister)
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apicallercb
|
||||
*/
|
||||
caller<T extends SimpleCacheKey>(callerCallback: (caller: TransformOptions["caller"]) => T): T;
|
||||
/**
|
||||
* While `api.version` can be useful in general, it's sometimes nice to just declare your version.
|
||||
* This API exposes a simple way to do that with:
|
||||
*
|
||||
* @example
|
||||
* api.assertVersion(7) // major version only
|
||||
* api.assertVersion("^7.2")
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apiassertversionrange
|
||||
*/
|
||||
assertVersion(versionRange: number | string): boolean;
|
||||
// NOTE: this is an undocumented reexport from "@babel/parser" but it's missing from its types
|
||||
// tokTypes: typeof tokTypes
|
||||
}
|
||||
|
||||
/**
|
||||
* JS configs are great because they can compute a config on the fly,
|
||||
* but the downside there is that it makes caching harder.
|
||||
* Babel wants to avoid re-executing the config function every time a file is compiled,
|
||||
* because then it would also need to re-execute any plugin and preset functions
|
||||
* referenced in that config.
|
||||
*
|
||||
* To avoid this, Babel expects users of config functions to tell it how to manage caching
|
||||
* within a config file.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apicache
|
||||
*/
|
||||
export interface SimpleCacheConfigurator {
|
||||
// there is an undocumented call signature that is a shorthand for forever()/never()/using().
|
||||
// (ever: boolean): void
|
||||
// <T extends SimpleCacheKey>(callback: CacheCallback<T>): T
|
||||
/**
|
||||
* Permacache the computed config and never call the function again.
|
||||
*/
|
||||
forever(): void;
|
||||
/**
|
||||
* Do not cache this config, and re-execute the function every time.
|
||||
*/
|
||||
never(): void;
|
||||
/**
|
||||
* Any time the using callback returns a value other than the one that was expected,
|
||||
* the overall config function will be called again and a new entry will be added to the cache.
|
||||
*
|
||||
* @example
|
||||
* api.cache.using(() => process.env.NODE_ENV)
|
||||
*/
|
||||
using<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
||||
/**
|
||||
* Any time the using callback returns a value other than the one that was expected,
|
||||
* the overall config function will be called again and all entries in the cache will
|
||||
* be replaced with the result.
|
||||
*
|
||||
* @example
|
||||
* api.cache.invalidate(() => process.env.NODE_ENV)
|
||||
*/
|
||||
invalidate<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
||||
}
|
||||
|
||||
// https://github.com/babel/babel/blob/v7.3.3/packages/babel-core/src/config/caching.js#L231
|
||||
export type SimpleCacheKey = string | boolean | number | null | undefined;
|
||||
export type SimpleCacheCallback<T extends SimpleCacheKey> = () => T;
|
||||
|
||||
/**
|
||||
* Since `NODE_ENV` is a fairly common way to toggle behavior, Babel also includes an API function
|
||||
* meant specifically for that. This API is used as a quick way to check the `"envName"` that Babel
|
||||
* was loaded with, which takes `NODE_ENV` into account if no other overriding environment is set.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apienv
|
||||
*/
|
||||
export interface EnvFunction {
|
||||
/**
|
||||
* @returns the current `envName` string
|
||||
*/
|
||||
(): string;
|
||||
/**
|
||||
* @returns `true` if the `envName` is `===` any of the given strings
|
||||
*/
|
||||
(envName: string | readonly string[]): boolean;
|
||||
// the official documentation is misleading for this one...
|
||||
// this just passes the callback to `cache.using` but with an additional argument.
|
||||
// it returns its result instead of necessarily returning a boolean.
|
||||
<T extends SimpleCacheKey>(envCallback: (envName: NonNullable<TransformOptions["envName"]>) => T): T;
|
||||
}
|
||||
|
||||
export type ConfigFunction = (api: ConfigAPI) => TransformOptions;
|
||||
|
||||
export as namespace babel;
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "@types/babel__core",
|
||||
"version": "7.20.5",
|
||||
"description": "TypeScript definitions for @babel/core",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__core",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Troy Gerwien",
|
||||
"githubUsername": "yortus",
|
||||
"url": "https://github.com/yortus"
|
||||
},
|
||||
{
|
||||
"name": "Marvin Hagemeister",
|
||||
"githubUsername": "marvinhagemeister",
|
||||
"url": "https://github.com/marvinhagemeister"
|
||||
},
|
||||
{
|
||||
"name": "Melvin Groenhoff",
|
||||
"githubUsername": "mgroenhoff",
|
||||
"url": "https://github.com/mgroenhoff"
|
||||
},
|
||||
{
|
||||
"name": "Jessica Franco",
|
||||
"githubUsername": "Jessidhia",
|
||||
"url": "https://github.com/Jessidhia"
|
||||
},
|
||||
{
|
||||
"name": "Ifiok Jr.",
|
||||
"githubUsername": "ifiokjr",
|
||||
"url": "https://github.com/ifiokjr"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/babel__core"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.20.7",
|
||||
"@babel/types": "^7.20.7",
|
||||
"@types/babel__generator": "*",
|
||||
"@types/babel__template": "*",
|
||||
"@types/babel__traverse": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "3ece429b02ff9f70503a5644f2b303b04d10e6da7940c91a9eff5e52f2c76b91",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/babel__generator`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for @babel/generator (https://github.com/babel/babel/tree/master/packages/babel-generator).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__generator.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Thu, 03 Apr 2025 16:02:41 GMT
|
||||
* Dependencies: [@babel/types](https://npmjs.com/package/@babel/types)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Melvin Groenhoff](https://github.com/mgroenhoff), [Cameron Yan](https://github.com/khell), and [Lyanbin](https://github.com/Lyanbin).
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
import * as t from "@babel/types";
|
||||
|
||||
export interface GeneratorOptions {
|
||||
/**
|
||||
* Optional string to add as a block comment at the start of the output file.
|
||||
*/
|
||||
auxiliaryCommentBefore?: string | undefined;
|
||||
|
||||
/**
|
||||
* Optional string to add as a block comment at the end of the output file.
|
||||
*/
|
||||
auxiliaryCommentAfter?: string | undefined;
|
||||
|
||||
/**
|
||||
* Function that takes a comment (as a string) and returns true if the comment should be included in the output.
|
||||
* By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment
|
||||
* contains `@preserve` or `@license`.
|
||||
*/
|
||||
shouldPrintComment?(comment: string): boolean;
|
||||
|
||||
/**
|
||||
* Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces).
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
retainLines?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Retain parens around function expressions (could be used to change engine parsing behavior)
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
retainFunctionParens?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Should comments be included in output? Defaults to `true`.
|
||||
*/
|
||||
comments?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`.
|
||||
*/
|
||||
compact?: boolean | "auto" | undefined;
|
||||
|
||||
/**
|
||||
* Should the output be minified. Defaults to `false`.
|
||||
*/
|
||||
minified?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`.
|
||||
*/
|
||||
concise?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Used in warning messages
|
||||
*/
|
||||
filename?: string | undefined;
|
||||
|
||||
/**
|
||||
* Enable generating source maps. Defaults to `false`.
|
||||
*/
|
||||
sourceMaps?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* A root for all relative URLs in the source map.
|
||||
*/
|
||||
sourceRoot?: string | undefined;
|
||||
|
||||
/**
|
||||
* The filename for the source code (i.e. the code in the `code` argument).
|
||||
* This will only be used if `code` is a string.
|
||||
*/
|
||||
sourceFileName?: string | undefined;
|
||||
|
||||
/**
|
||||
* Set to true to run jsesc with "json": true to print "\u00A9" vs. "©";
|
||||
*/
|
||||
jsonCompatibleStrings?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Set to true to enable support for experimental decorators syntax before module exports.
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
decoratorsBeforeExport?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The import attributes/assertions syntax to use.
|
||||
* When not specified, @babel/generator will try to match the style in the input code based on the AST shape.
|
||||
*/
|
||||
importAttributesKeyword?: "with" | "assert" | "with-legacy";
|
||||
|
||||
/**
|
||||
* Options for outputting jsesc representation.
|
||||
*/
|
||||
jsescOption?: {
|
||||
/**
|
||||
* The default value for the quotes option is 'single'. This means that any occurrences of ' in the input
|
||||
* string are escaped as \', so that the output can be used in a string literal wrapped in single quotes.
|
||||
*/
|
||||
quotes?: "single" | "double" | "backtick" | undefined;
|
||||
|
||||
/**
|
||||
* The default value for the numbers option is 'decimal'. This means that any numeric values are represented
|
||||
* using decimal integer literals. Other valid options are binary, octal, and hexadecimal, which result in
|
||||
* binary integer literals, octal integer literals, and hexadecimal integer literals, respectively.
|
||||
*/
|
||||
numbers?: "binary" | "octal" | "decimal" | "hexadecimal" | undefined;
|
||||
|
||||
/**
|
||||
* The wrap option takes a boolean value (true or false), and defaults to false (disabled). When enabled, the
|
||||
* output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through
|
||||
* the quotes setting.
|
||||
*/
|
||||
wrap?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The es6 option takes a boolean value (true or false), and defaults to false (disabled). When enabled, any
|
||||
* astral Unicode symbols in the input are escaped using ECMAScript 6 Unicode code point escape sequences
|
||||
* instead of using separate escape sequences for each surrogate half. If backwards compatibility with ES5
|
||||
* environments is a concern, don’t enable this setting. If the json setting is enabled, the value for the es6
|
||||
* setting is ignored (as if it was false).
|
||||
*/
|
||||
es6?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The escapeEverything option takes a boolean value (true or false), and defaults to false (disabled). When
|
||||
* enabled, all the symbols in the output are escaped — even printable ASCII symbols.
|
||||
*/
|
||||
escapeEverything?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The minimal option takes a boolean value (true or false), and defaults to false (disabled). When enabled,
|
||||
* only a limited set of symbols in the output are escaped: \0, \b, \t, \n, \f, \r, \\, \u2028, \u2029.
|
||||
*/
|
||||
minimal?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The isScriptContext option takes a boolean value (true or false), and defaults to false (disabled). When
|
||||
* enabled, occurrences of </script and </style in the output are escaped as <\/script and <\/style, and <!--
|
||||
* is escaped as \x3C!-- (or \u003C!-- when the json option is enabled). This setting is useful when jsesc’s
|
||||
* output ends up as part of a <script> or <style> element in an HTML document.
|
||||
*/
|
||||
isScriptContext?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The compact option takes a boolean value (true or false), and defaults to true (enabled). When enabled,
|
||||
* the output for arrays and objects is as compact as possible; it’s not formatted nicely.
|
||||
*/
|
||||
compact?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The indent option takes a string value, and defaults to '\t'. When the compact setting is enabled (true),
|
||||
* the value of the indent option is used to format the output for arrays and objects.
|
||||
*/
|
||||
indent?: string | undefined;
|
||||
|
||||
/**
|
||||
* The indentLevel option takes a numeric value, and defaults to 0. It represents the current indentation level,
|
||||
* i.e. the number of times the value of the indent option is repeated.
|
||||
*/
|
||||
indentLevel?: number | undefined;
|
||||
|
||||
/**
|
||||
* The json option takes a boolean value (true or false), and defaults to false (disabled). When enabled, the
|
||||
* output is valid JSON. Hexadecimal character escape sequences and the \v or \0 escape sequences are not used.
|
||||
* Setting json: true implies quotes: 'double', wrap: true, es6: false, although these values can still be
|
||||
* overridden if needed — but in such cases, the output won’t be valid JSON anymore.
|
||||
*/
|
||||
json?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The lowercaseHex option takes a boolean value (true or false), and defaults to false (disabled). When enabled,
|
||||
* any alphabetical hexadecimal digits in escape sequences as well as any hexadecimal integer literals (see the
|
||||
* numbers option) in the output are in lowercase.
|
||||
*/
|
||||
lowercaseHex?: boolean | undefined;
|
||||
} | undefined;
|
||||
}
|
||||
|
||||
export class CodeGenerator {
|
||||
constructor(ast: t.Node, opts?: GeneratorOptions, code?: string);
|
||||
generate(): GeneratorResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns an AST into code, maintaining sourcemaps, user preferences, and valid output.
|
||||
* @param ast - the abstract syntax tree from which to generate output code.
|
||||
* @param opts - used for specifying options for code generation.
|
||||
* @param code - the original source code, used for source maps.
|
||||
* @returns - an object containing the output code and source map.
|
||||
*/
|
||||
export function generate(
|
||||
ast: t.Node,
|
||||
opts?: GeneratorOptions,
|
||||
code?: string | { [filename: string]: string },
|
||||
): GeneratorResult;
|
||||
|
||||
export default generate;
|
||||
|
||||
export interface GeneratorResult {
|
||||
code: string;
|
||||
map: {
|
||||
version: number;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourceRoot?: string | undefined;
|
||||
sourcesContent?: string[] | undefined;
|
||||
mappings: string;
|
||||
file: string;
|
||||
} | null;
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "@types/babel__generator",
|
||||
"version": "7.27.0",
|
||||
"description": "TypeScript definitions for @babel/generator",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__generator",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Troy Gerwien",
|
||||
"githubUsername": "yortus",
|
||||
"url": "https://github.com/yortus"
|
||||
},
|
||||
{
|
||||
"name": "Melvin Groenhoff",
|
||||
"githubUsername": "mgroenhoff",
|
||||
"url": "https://github.com/mgroenhoff"
|
||||
},
|
||||
{
|
||||
"name": "Cameron Yan",
|
||||
"githubUsername": "khell",
|
||||
"url": "https://github.com/khell"
|
||||
},
|
||||
{
|
||||
"name": "Lyanbin",
|
||||
"githubUsername": "Lyanbin",
|
||||
"url": "https://github.com/Lyanbin"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/babel__generator"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.0.0"
|
||||
},
|
||||
"peerDependencies": {},
|
||||
"typesPublisherContentHash": "b5c7deac65dbd6ab9b313d1d71c86afe4383b881dcb4e3b3ac51dab07b8f95fb",
|
||||
"typeScriptVersion": "5.1"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/babel__template`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for @babel/template (https://github.com/babel/babel/tree/master/packages/babel-template).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 06 Nov 2023 22:41:04 GMT
|
||||
* Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), and [ExE Boss](https://github.com/ExE-Boss).
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
import { ParserOptions } from "@babel/parser";
|
||||
import { Expression, Program, Statement } from "@babel/types";
|
||||
|
||||
export interface TemplateBuilderOptions extends ParserOptions {
|
||||
/**
|
||||
* A set of placeholder names to automatically accept.
|
||||
* Items in this list do not need to match `placeholderPattern`.
|
||||
*
|
||||
* This option cannot be used when using `%%foo%%` style placeholders.
|
||||
*/
|
||||
placeholderWhitelist?: Set<string> | null | undefined;
|
||||
|
||||
/**
|
||||
* A pattern to search for when looking for `Identifier` and `StringLiteral`
|
||||
* nodes that should be considered as placeholders.
|
||||
*
|
||||
* `false` will disable placeholder searching placeholders, leaving only
|
||||
* the `placeholderWhitelist` value to find replacements.
|
||||
*
|
||||
* This option cannot be used when using `%%foo%%` style placeholders.
|
||||
*
|
||||
* @default /^[_$A-Z0-9]+$/
|
||||
*/
|
||||
placeholderPattern?: RegExp | false | null | undefined;
|
||||
|
||||
/**
|
||||
* Set this to `true` to preserve comments from the template string
|
||||
* into the resulting AST, or `false` to automatically discard comments.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
preserveComments?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to use `%%foo%%` style placeholders, `false` to use legacy placeholders
|
||||
* described by `placeholderPattern` or `placeholderWhitelist`.
|
||||
*
|
||||
* When it is not set, it behaves as `true` if there are syntactic placeholders, otherwise as `false`.
|
||||
*
|
||||
* @since 7.4.0
|
||||
*/
|
||||
syntacticPlaceholders?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
export interface TemplateBuilder<T> {
|
||||
/**
|
||||
* Build a new builder, merging the given options with the previous ones.
|
||||
*/
|
||||
(opts: TemplateBuilderOptions): TemplateBuilder<T>;
|
||||
|
||||
/**
|
||||
* Building from a string produces an AST builder function by default.
|
||||
*/
|
||||
(code: string, opts?: TemplateBuilderOptions): (arg?: PublicReplacements) => T;
|
||||
|
||||
/**
|
||||
* Building from a template literal produces an AST builder function by default.
|
||||
*/
|
||||
(tpl: TemplateStringsArray, ...args: unknown[]): (arg?: PublicReplacements) => T;
|
||||
|
||||
/**
|
||||
* Allow users to explicitly create templates that produce ASTs,
|
||||
* skipping the need for an intermediate function.
|
||||
*
|
||||
* Does not allow `%%foo%%` style placeholders.
|
||||
*/
|
||||
ast: {
|
||||
(tpl: string, opts?: TemplateBuilderOptions): T;
|
||||
(tpl: TemplateStringsArray, ...args: unknown[]): T;
|
||||
};
|
||||
}
|
||||
|
||||
export type PublicReplacements = { [index: string]: unknown } | unknown[];
|
||||
|
||||
export const smart: TemplateBuilder<Statement | Statement[]>;
|
||||
export const statement: TemplateBuilder<Statement>;
|
||||
export const statements: TemplateBuilder<Statement[]>;
|
||||
export const expression: TemplateBuilder<Expression>;
|
||||
export const program: TemplateBuilder<Program>;
|
||||
|
||||
type DefaultTemplateBuilder = typeof smart & {
|
||||
smart: typeof smart;
|
||||
statement: typeof statement;
|
||||
statements: typeof statements;
|
||||
expression: typeof expression;
|
||||
program: typeof program;
|
||||
ast: typeof smart.ast;
|
||||
};
|
||||
|
||||
declare const templateBuilder: DefaultTemplateBuilder;
|
||||
|
||||
export default templateBuilder;
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "@types/babel__template",
|
||||
"version": "7.4.4",
|
||||
"description": "TypeScript definitions for @babel/template",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Troy Gerwien",
|
||||
"githubUsername": "yortus",
|
||||
"url": "https://github.com/yortus"
|
||||
},
|
||||
{
|
||||
"name": "Marvin Hagemeister",
|
||||
"githubUsername": "marvinhagemeister",
|
||||
"url": "https://github.com/marvinhagemeister"
|
||||
},
|
||||
{
|
||||
"name": "Melvin Groenhoff",
|
||||
"githubUsername": "mgroenhoff",
|
||||
"url": "https://github.com/mgroenhoff"
|
||||
},
|
||||
{
|
||||
"name": "ExE Boss",
|
||||
"githubUsername": "ExE-Boss",
|
||||
"url": "https://github.com/ExE-Boss"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/babel__template"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.1.0",
|
||||
"@babel/types": "^7.0.0"
|
||||
},
|
||||
"typesPublisherContentHash": "5730d754b4d1fcd41676b093f9e32b340c749c4d37b126dfa312e394467e86c6",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/babel__traverse`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for @babel/traverse (https://github.com/babel/babel/tree/main/packages/babel-traverse).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__traverse.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Thu, 31 Jul 2025 21:02:30 GMT
|
||||
* Dependencies: [@babel/types](https://npmjs.com/package/@babel/types)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Ryan Petrich](https://github.com/rpetrich), [Melvin Groenhoff](https://github.com/mgroenhoff), [Dean L.](https://github.com/dlgrit), [Ifiok Jr.](https://github.com/ifiokjr), [ExE Boss](https://github.com/ExE-Boss), and [Daniel Tschinder](https://github.com/danez).
|
||||
+1506
File diff suppressed because it is too large.
Load diff
+63
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"name": "@types/babel__traverse",
|
||||
"version": "7.28.0",
|
||||
"description": "TypeScript definitions for @babel/traverse",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__traverse",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Troy Gerwien",
|
||||
"githubUsername": "yortus",
|
||||
"url": "https://github.com/yortus"
|
||||
},
|
||||
{
|
||||
"name": "Marvin Hagemeister",
|
||||
"githubUsername": "marvinhagemeister",
|
||||
"url": "https://github.com/marvinhagemeister"
|
||||
},
|
||||
{
|
||||
"name": "Ryan Petrich",
|
||||
"githubUsername": "rpetrich",
|
||||
"url": "https://github.com/rpetrich"
|
||||
},
|
||||
{
|
||||
"name": "Melvin Groenhoff",
|
||||
"githubUsername": "mgroenhoff",
|
||||
"url": "https://github.com/mgroenhoff"
|
||||
},
|
||||
{
|
||||
"name": "Dean L.",
|
||||
"githubUsername": "dlgrit",
|
||||
"url": "https://github.com/dlgrit"
|
||||
},
|
||||
{
|
||||
"name": "Ifiok Jr.",
|
||||
"githubUsername": "ifiokjr",
|
||||
"url": "https://github.com/ifiokjr"
|
||||
},
|
||||
{
|
||||
"name": "ExE Boss",
|
||||
"githubUsername": "ExE-Boss",
|
||||
"url": "https://github.com/ExE-Boss"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Tschinder",
|
||||
"githubUsername": "danez",
|
||||
"url": "https://github.com/danez"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/babel__traverse"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.28.2"
|
||||
},
|
||||
"peerDependencies": {},
|
||||
"typesPublisherContentHash": "f8bf439253873b2b30a22c425df086f130320cf70d832d84412e82a51e410680",
|
||||
"typeScriptVersion": "5.1"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/cookie`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for cookie (https://github.com/jshttp/cookie).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Sun, 26 Nov 2023 22:07:01 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Pine Mizune](https://github.com/pine), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
/**
|
||||
* Basic HTTP cookie parser and serializer for HTTP servers.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Additional serialization options
|
||||
*/
|
||||
export interface CookieSerializeOptions {
|
||||
/**
|
||||
* Specifies the value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.3|Domain Set-Cookie attribute}. By default, no
|
||||
* domain is set, and most clients will consider the cookie to apply to only
|
||||
* the current domain.
|
||||
*/
|
||||
domain?: string | undefined;
|
||||
|
||||
/**
|
||||
* Specifies a function that will be used to encode a cookie's value. Since
|
||||
* value of a cookie has a limited character set (and must be a simple
|
||||
* string), this function can be used to encode a value into a string suited
|
||||
* for a cookie's value.
|
||||
*
|
||||
* The default function is the global `encodeURIComponent`, which will
|
||||
* encode a JavaScript string into UTF-8 byte sequences and then URL-encode
|
||||
* any that fall outside of the cookie range.
|
||||
*/
|
||||
encode?(value: string): string;
|
||||
|
||||
/**
|
||||
* Specifies the `Date` object to be the value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.1|`Expires` `Set-Cookie` attribute}. By default,
|
||||
* no expiration is set, and most clients will consider this a "non-persistent cookie" and will delete
|
||||
* it on a condition like exiting a web browser application.
|
||||
*
|
||||
* *Note* the {@link https://tools.ietf.org/html/rfc6265#section-5.3|cookie storage model specification}
|
||||
* states that if both `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is
|
||||
* possible not all clients by obey this, so if both are set, they should
|
||||
* point to the same date and time.
|
||||
*/
|
||||
expires?: Date | undefined;
|
||||
/**
|
||||
* Specifies the boolean value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.6|`HttpOnly` `Set-Cookie` attribute}.
|
||||
* When truthy, the `HttpOnly` attribute is set, otherwise it is not. By
|
||||
* default, the `HttpOnly` attribute is not set.
|
||||
*
|
||||
* *Note* be careful when setting this to true, as compliant clients will
|
||||
* not allow client-side JavaScript to see the cookie in `document.cookie`.
|
||||
*/
|
||||
httpOnly?: boolean | undefined;
|
||||
/**
|
||||
* Specifies the number (in seconds) to be the value for the `Max-Age`
|
||||
* `Set-Cookie` attribute. The given number will be converted to an integer
|
||||
* by rounding down. By default, no maximum age is set.
|
||||
*
|
||||
* *Note* the {@link https://tools.ietf.org/html/rfc6265#section-5.3|cookie storage model specification}
|
||||
* states that if both `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is
|
||||
* possible not all clients by obey this, so if both are set, they should
|
||||
* point to the same date and time.
|
||||
*/
|
||||
maxAge?: number | undefined;
|
||||
/**
|
||||
* Specifies the `boolean` value for the [`Partitioned` `Set-Cookie`](rfc-cutler-httpbis-partitioned-cookies)
|
||||
* attribute. When truthy, the `Partitioned` attribute is set, otherwise it is not. By default, the
|
||||
* `Partitioned` attribute is not set.
|
||||
*
|
||||
* **note** This is an attribute that has not yet been fully standardized, and may change in the future.
|
||||
* This also means many clients may ignore this attribute until they understand it.
|
||||
*
|
||||
* More information about can be found in [the proposal](https://github.com/privacycg/CHIPS)
|
||||
*/
|
||||
partitioned?: boolean | undefined;
|
||||
/**
|
||||
* Specifies the value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.4|`Path` `Set-Cookie` attribute}.
|
||||
* By default, the path is considered the "default path".
|
||||
*/
|
||||
path?: string | undefined;
|
||||
/**
|
||||
* Specifies the `string` to be the value for the [`Priority` `Set-Cookie` attribute][rfc-west-cookie-priority-00-4.1].
|
||||
*
|
||||
* - `'low'` will set the `Priority` attribute to `Low`.
|
||||
* - `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set.
|
||||
* - `'high'` will set the `Priority` attribute to `High`.
|
||||
*
|
||||
* More information about the different priority levels can be found in
|
||||
* [the specification][rfc-west-cookie-priority-00-4.1].
|
||||
*
|
||||
* **note** This is an attribute that has not yet been fully standardized, and may change in the future.
|
||||
* This also means many clients may ignore this attribute until they understand it.
|
||||
*/
|
||||
priority?: "low" | "medium" | "high" | undefined;
|
||||
/**
|
||||
* Specifies the boolean or string to be the value for the {@link https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7|`SameSite` `Set-Cookie` attribute}.
|
||||
*
|
||||
* - `true` will set the `SameSite` attribute to `Strict` for strict same
|
||||
* site enforcement.
|
||||
* - `false` will not set the `SameSite` attribute.
|
||||
* - `'lax'` will set the `SameSite` attribute to Lax for lax same site
|
||||
* enforcement.
|
||||
* - `'strict'` will set the `SameSite` attribute to Strict for strict same
|
||||
* site enforcement.
|
||||
* - `'none'` will set the SameSite attribute to None for an explicit
|
||||
* cross-site cookie.
|
||||
*
|
||||
* More information about the different enforcement levels can be found in {@link https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7|the specification}.
|
||||
*
|
||||
* *note* This is an attribute that has not yet been fully standardized, and may change in the future. This also means many clients may ignore this attribute until they understand it.
|
||||
*/
|
||||
sameSite?: true | false | "lax" | "strict" | "none" | undefined;
|
||||
/**
|
||||
* Specifies the boolean value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.5|`Secure` `Set-Cookie` attribute}. When truthy, the
|
||||
* `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set.
|
||||
*
|
||||
* *Note* be careful when setting this to `true`, as compliant clients will
|
||||
* not send the cookie back to the server in the future if the browser does
|
||||
* not have an HTTPS connection.
|
||||
*/
|
||||
secure?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional parsing options
|
||||
*/
|
||||
export interface CookieParseOptions {
|
||||
/**
|
||||
* Specifies a function that will be used to decode a cookie's value. Since
|
||||
* the value of a cookie has a limited character set (and must be a simple
|
||||
* string), this function can be used to decode a previously-encoded cookie
|
||||
* value into a JavaScript string or other object.
|
||||
*
|
||||
* The default function is the global `decodeURIComponent`, which will decode
|
||||
* any URL-encoded sequences into their byte representations.
|
||||
*
|
||||
* *Note* if an error is thrown from this function, the original, non-decoded
|
||||
* cookie value will be returned as the cookie's value.
|
||||
*/
|
||||
decode?(value: string): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an HTTP Cookie header string and returning an object of all cookie
|
||||
* name-value pairs.
|
||||
*
|
||||
* @param str the string representing a `Cookie` header value
|
||||
* @param [options] object containing parsing options
|
||||
*/
|
||||
export function parse(str: string, options?: CookieParseOptions): Record<string, string>;
|
||||
|
||||
/**
|
||||
* Serialize a cookie name-value pair into a `Set-Cookie` header string.
|
||||
*
|
||||
* @param name the name for the cookie
|
||||
* @param value value to set the cookie to
|
||||
* @param [options] object containing serialization options
|
||||
* @throws {TypeError} when `maxAge` options is invalid
|
||||
*/
|
||||
export function serialize(name: string, value: string, options?: CookieSerializeOptions): string;
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "@types/cookie",
|
||||
"version": "0.6.0",
|
||||
"description": "TypeScript definitions for cookie",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Pine Mizune",
|
||||
"githubUsername": "pine",
|
||||
"url": "https://github.com/pine"
|
||||
},
|
||||
{
|
||||
"name": "Piotr Błażejewicz",
|
||||
"githubUsername": "peterblazejewicz",
|
||||
"url": "https://github.com/peterblazejewicz"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/cookie"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "0fbdf9c886fb40c8dc7677b8b7d0f9e02ac5235e163d90244a4fb9004736a575",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
# Installation
|
||||
> `npm install --save @types/debug`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for debug (https://github.com/debug-js/debug).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/debug.
|
||||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/debug/index.d.ts)
|
||||
````ts
|
||||
declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };
|
||||
|
||||
export = debug;
|
||||
export as namespace debug;
|
||||
|
||||
declare namespace debug {
|
||||
interface Debug {
|
||||
(namespace: string): Debugger;
|
||||
coerce: (val: any) => any;
|
||||
disable: () => string;
|
||||
enable: (namespaces: string) => void;
|
||||
enabled: (namespaces: string) => boolean;
|
||||
formatArgs: (this: Debugger, args: any[]) => void;
|
||||
log: (...args: any[]) => any;
|
||||
selectColor: (namespace: string) => string | number;
|
||||
humanize: typeof import("ms");
|
||||
|
||||
names: string[];
|
||||
skips: string[];
|
||||
|
||||
formatters: Formatters;
|
||||
|
||||
inspectOpts?: {
|
||||
hideDate?: boolean | number | null;
|
||||
colors?: boolean | number | null;
|
||||
depth?: boolean | number | null;
|
||||
showHidden?: boolean | number | null;
|
||||
};
|
||||
}
|
||||
|
||||
type IDebug = Debug;
|
||||
|
||||
interface Formatters {
|
||||
[formatter: string]: (v: any) => string;
|
||||
}
|
||||
|
||||
type IDebugger = Debugger;
|
||||
|
||||
interface Debugger {
|
||||
(formatter: any, ...args: any[]): void;
|
||||
|
||||
color: string;
|
||||
diff: number;
|
||||
enabled: boolean;
|
||||
log: (...args: any[]) => any;
|
||||
namespace: string;
|
||||
destroy: () => boolean;
|
||||
extend: (namespace: string, delimiter?: string) => Debugger;
|
||||
}
|
||||
}
|
||||
|
||||
````
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Thu, 19 Mar 2026 06:47:22 GMT
|
||||
* Dependencies: [@types/ms](https://npmjs.com/package/@types/ms)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Seon-Wook Park](https://github.com/swook), [Gal Talmor](https://github.com/galtalmor), [John McLaughlin](https://github.com/zamb3zi), [Brasten Sager](https://github.com/brasten), [Nicolas Penin](https://github.com/npenin), [Kristian Brünn](https://github.com/kristianmitk), and [Caleb Gregory](https://github.com/calebgregory).
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };
|
||||
|
||||
export = debug;
|
||||
export as namespace debug;
|
||||
|
||||
declare namespace debug {
|
||||
interface Debug {
|
||||
(namespace: string): Debugger;
|
||||
coerce: (val: any) => any;
|
||||
disable: () => string;
|
||||
enable: (namespaces: string) => void;
|
||||
enabled: (namespaces: string) => boolean;
|
||||
formatArgs: (this: Debugger, args: any[]) => void;
|
||||
log: (...args: any[]) => any;
|
||||
selectColor: (namespace: string) => string | number;
|
||||
humanize: typeof import("ms");
|
||||
|
||||
names: string[];
|
||||
skips: string[];
|
||||
|
||||
formatters: Formatters;
|
||||
|
||||
inspectOpts?: {
|
||||
hideDate?: boolean | number | null;
|
||||
colors?: boolean | number | null;
|
||||
depth?: boolean | number | null;
|
||||
showHidden?: boolean | number | null;
|
||||
};
|
||||
}
|
||||
|
||||
type IDebug = Debug;
|
||||
|
||||
interface Formatters {
|
||||
[formatter: string]: (v: any) => string;
|
||||
}
|
||||
|
||||
type IDebugger = Debugger;
|
||||
|
||||
interface Debugger {
|
||||
(formatter: any, ...args: any[]): void;
|
||||
|
||||
color: string;
|
||||
diff: number;
|
||||
enabled: boolean;
|
||||
log: (...args: any[]) => any;
|
||||
namespace: string;
|
||||
destroy: () => boolean;
|
||||
extend: (namespace: string, delimiter?: string) => Debugger;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "@types/debug",
|
||||
"version": "4.1.13",
|
||||
"description": "TypeScript definitions for debug",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/debug",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Seon-Wook Park",
|
||||
"githubUsername": "swook",
|
||||
"url": "https://github.com/swook"
|
||||
},
|
||||
{
|
||||
"name": "Gal Talmor",
|
||||
"githubUsername": "galtalmor",
|
||||
"url": "https://github.com/galtalmor"
|
||||
},
|
||||
{
|
||||
"name": "John McLaughlin",
|
||||
"githubUsername": "zamb3zi",
|
||||
"url": "https://github.com/zamb3zi"
|
||||
},
|
||||
{
|
||||
"name": "Brasten Sager",
|
||||
"githubUsername": "brasten",
|
||||
"url": "https://github.com/brasten"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Penin",
|
||||
"githubUsername": "npenin",
|
||||
"url": "https://github.com/npenin"
|
||||
},
|
||||
{
|
||||
"name": "Kristian Brünn",
|
||||
"githubUsername": "kristianmitk",
|
||||
"url": "https://github.com/kristianmitk"
|
||||
},
|
||||
{
|
||||
"name": "Caleb Gregory",
|
||||
"githubUsername": "calebgregory",
|
||||
"url": "https://github.com/calebgregory"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/debug"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/ms": "*"
|
||||
},
|
||||
"peerDependencies": {},
|
||||
"typesPublisherContentHash": "1c506e100366b85350ff1c28c9cf4cc09e9a07275546bb050993c241c9821cd9",
|
||||
"typeScriptVersion": "5.2"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/estree`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for estree (https://github.com/estree/estree).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 06 May 2026 21:01:00 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [RReverser](https://github.com/RReverser).
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
declare namespace ESTree {
|
||||
interface FlowTypeAnnotation extends Node {}
|
||||
|
||||
interface FlowBaseTypeAnnotation extends FlowTypeAnnotation {}
|
||||
|
||||
interface FlowLiteralTypeAnnotation extends FlowTypeAnnotation, Literal {}
|
||||
|
||||
interface FlowDeclaration extends Declaration {}
|
||||
|
||||
interface AnyTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface ArrayTypeAnnotation extends FlowTypeAnnotation {
|
||||
elementType: FlowTypeAnnotation;
|
||||
}
|
||||
|
||||
interface BooleanLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}
|
||||
|
||||
interface BooleanTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface ClassImplements extends Node {
|
||||
id: Identifier;
|
||||
typeParameters?: TypeParameterInstantiation | null;
|
||||
}
|
||||
|
||||
interface ClassProperty {
|
||||
key: Expression;
|
||||
value?: Expression | null;
|
||||
typeAnnotation?: TypeAnnotation | null;
|
||||
computed: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
interface DeclareClass extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
typeParameters?: TypeParameterDeclaration | null;
|
||||
body: ObjectTypeAnnotation;
|
||||
extends: InterfaceExtends[];
|
||||
}
|
||||
|
||||
interface DeclareFunction extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
interface DeclareModule extends FlowDeclaration {
|
||||
id: Literal | Identifier;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
interface DeclareVariable extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
interface FunctionTypeAnnotation extends FlowTypeAnnotation {
|
||||
params: FunctionTypeParam[];
|
||||
returnType: FlowTypeAnnotation;
|
||||
rest?: FunctionTypeParam | null;
|
||||
typeParameters?: TypeParameterDeclaration | null;
|
||||
}
|
||||
|
||||
interface FunctionTypeParam {
|
||||
name: Identifier;
|
||||
typeAnnotation: FlowTypeAnnotation;
|
||||
optional: boolean;
|
||||
}
|
||||
|
||||
interface GenericTypeAnnotation extends FlowTypeAnnotation {
|
||||
id: Identifier | QualifiedTypeIdentifier;
|
||||
typeParameters?: TypeParameterInstantiation | null;
|
||||
}
|
||||
|
||||
interface InterfaceExtends extends Node {
|
||||
id: Identifier | QualifiedTypeIdentifier;
|
||||
typeParameters?: TypeParameterInstantiation | null;
|
||||
}
|
||||
|
||||
interface InterfaceDeclaration extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
typeParameters?: TypeParameterDeclaration | null;
|
||||
extends: InterfaceExtends[];
|
||||
body: ObjectTypeAnnotation;
|
||||
}
|
||||
|
||||
interface IntersectionTypeAnnotation extends FlowTypeAnnotation {
|
||||
types: FlowTypeAnnotation[];
|
||||
}
|
||||
|
||||
interface MixedTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface NullableTypeAnnotation extends FlowTypeAnnotation {
|
||||
typeAnnotation: TypeAnnotation;
|
||||
}
|
||||
|
||||
interface NumberLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}
|
||||
|
||||
interface NumberTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface StringLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}
|
||||
|
||||
interface StringTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface TupleTypeAnnotation extends FlowTypeAnnotation {
|
||||
types: FlowTypeAnnotation[];
|
||||
}
|
||||
|
||||
interface TypeofTypeAnnotation extends FlowTypeAnnotation {
|
||||
argument: FlowTypeAnnotation;
|
||||
}
|
||||
|
||||
interface TypeAlias extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
typeParameters?: TypeParameterDeclaration | null;
|
||||
right: FlowTypeAnnotation;
|
||||
}
|
||||
|
||||
interface TypeAnnotation extends Node {
|
||||
typeAnnotation: FlowTypeAnnotation;
|
||||
}
|
||||
|
||||
interface TypeCastExpression extends Expression {
|
||||
expression: Expression;
|
||||
typeAnnotation: TypeAnnotation;
|
||||
}
|
||||
|
||||
interface TypeParameterDeclaration extends Node {
|
||||
params: Identifier[];
|
||||
}
|
||||
|
||||
interface TypeParameterInstantiation extends Node {
|
||||
params: FlowTypeAnnotation[];
|
||||
}
|
||||
|
||||
interface ObjectTypeAnnotation extends FlowTypeAnnotation {
|
||||
properties: ObjectTypeProperty[];
|
||||
indexers: ObjectTypeIndexer[];
|
||||
callProperties: ObjectTypeCallProperty[];
|
||||
}
|
||||
|
||||
interface ObjectTypeCallProperty extends Node {
|
||||
value: FunctionTypeAnnotation;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
interface ObjectTypeIndexer extends Node {
|
||||
id: Identifier;
|
||||
key: FlowTypeAnnotation;
|
||||
value: FlowTypeAnnotation;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
interface ObjectTypeProperty extends Node {
|
||||
key: Expression;
|
||||
value: FlowTypeAnnotation;
|
||||
optional: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
interface QualifiedTypeIdentifier extends Node {
|
||||
qualification: Identifier | QualifiedTypeIdentifier;
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
interface UnionTypeAnnotation extends FlowTypeAnnotation {
|
||||
types: FlowTypeAnnotation[];
|
||||
}
|
||||
|
||||
interface VoidTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
}
|
||||
+694
@@ -0,0 +1,694 @@
|
||||
// This definition file follows a somewhat unusual format. ESTree allows
|
||||
// runtime type checks based on the `type` parameter. In order to explain this
|
||||
// to typescript we want to use discriminated union types:
|
||||
// https://github.com/Microsoft/TypeScript/pull/9163
|
||||
//
|
||||
// For ESTree this is a bit tricky because the high level interfaces like
|
||||
// Node or Function are pulling double duty. We want to pass common fields down
|
||||
// to the interfaces that extend them (like Identifier or
|
||||
// ArrowFunctionExpression), but you can't extend a type union or enforce
|
||||
// common fields on them. So we've split the high level interfaces into two
|
||||
// types, a base type which passes down inherited fields, and a type union of
|
||||
// all types which extend the base type. Only the type union is exported, and
|
||||
// the union is how other types refer to the collection of inheriting types.
|
||||
//
|
||||
// This makes the definitions file here somewhat more difficult to maintain,
|
||||
// but it has the notable advantage of making ESTree much easier to use as
|
||||
// an end user.
|
||||
|
||||
export interface BaseNodeWithoutComments {
|
||||
// Every leaf interface that extends BaseNode must specify a type property.
|
||||
// The type property should be a string literal. For example, Identifier
|
||||
// has: `type: "Identifier"`
|
||||
type: string;
|
||||
loc?: SourceLocation | null | undefined;
|
||||
range?: [number, number] | undefined;
|
||||
}
|
||||
|
||||
export interface BaseNode extends BaseNodeWithoutComments {
|
||||
leadingComments?: Comment[] | undefined;
|
||||
trailingComments?: Comment[] | undefined;
|
||||
}
|
||||
|
||||
export interface NodeMap {
|
||||
AssignmentProperty: AssignmentProperty;
|
||||
CatchClause: CatchClause;
|
||||
Class: Class;
|
||||
ClassBody: ClassBody;
|
||||
Expression: Expression;
|
||||
Function: Function;
|
||||
Identifier: Identifier;
|
||||
Literal: Literal;
|
||||
MethodDefinition: MethodDefinition;
|
||||
ModuleDeclaration: ModuleDeclaration;
|
||||
ModuleSpecifier: ModuleSpecifier;
|
||||
Pattern: Pattern;
|
||||
PrivateIdentifier: PrivateIdentifier;
|
||||
Program: Program;
|
||||
Property: Property;
|
||||
PropertyDefinition: PropertyDefinition;
|
||||
SpreadElement: SpreadElement;
|
||||
Statement: Statement;
|
||||
Super: Super;
|
||||
SwitchCase: SwitchCase;
|
||||
TemplateElement: TemplateElement;
|
||||
VariableDeclarator: VariableDeclarator;
|
||||
}
|
||||
|
||||
export type Node = NodeMap[keyof NodeMap];
|
||||
|
||||
export interface Comment extends BaseNodeWithoutComments {
|
||||
type: "Line" | "Block";
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface SourceLocation {
|
||||
source?: string | null | undefined;
|
||||
start: Position;
|
||||
end: Position;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
/** >= 1 */
|
||||
line: number;
|
||||
/** >= 0 */
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface Program extends BaseNode {
|
||||
type: "Program";
|
||||
sourceType: "script" | "module";
|
||||
body: Array<Directive | Statement | ModuleDeclaration>;
|
||||
comments?: Comment[] | undefined;
|
||||
}
|
||||
|
||||
export interface Directive extends BaseNode {
|
||||
type: "ExpressionStatement";
|
||||
expression: Literal;
|
||||
directive: string;
|
||||
}
|
||||
|
||||
export interface BaseFunction extends BaseNode {
|
||||
params: Pattern[];
|
||||
generator?: boolean | undefined;
|
||||
async?: boolean | undefined;
|
||||
// The body is either BlockStatement or Expression because arrow functions
|
||||
// can have a body that's either. FunctionDeclarations and
|
||||
// FunctionExpressions have only BlockStatement bodies.
|
||||
body: BlockStatement | Expression;
|
||||
}
|
||||
|
||||
export type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
||||
|
||||
export type Statement =
|
||||
| ExpressionStatement
|
||||
| BlockStatement
|
||||
| StaticBlock
|
||||
| EmptyStatement
|
||||
| DebuggerStatement
|
||||
| WithStatement
|
||||
| ReturnStatement
|
||||
| LabeledStatement
|
||||
| BreakStatement
|
||||
| ContinueStatement
|
||||
| IfStatement
|
||||
| SwitchStatement
|
||||
| ThrowStatement
|
||||
| TryStatement
|
||||
| WhileStatement
|
||||
| DoWhileStatement
|
||||
| ForStatement
|
||||
| ForInStatement
|
||||
| ForOfStatement
|
||||
| Declaration;
|
||||
|
||||
export interface BaseStatement extends BaseNode {}
|
||||
|
||||
export interface EmptyStatement extends BaseStatement {
|
||||
type: "EmptyStatement";
|
||||
}
|
||||
|
||||
export interface BlockStatement extends BaseStatement {
|
||||
type: "BlockStatement";
|
||||
body: Statement[];
|
||||
innerComments?: Comment[] | undefined;
|
||||
}
|
||||
|
||||
export interface StaticBlock extends Omit<BlockStatement, "type"> {
|
||||
type: "StaticBlock";
|
||||
}
|
||||
|
||||
export interface ExpressionStatement extends BaseStatement {
|
||||
type: "ExpressionStatement";
|
||||
expression: Expression;
|
||||
}
|
||||
|
||||
export interface IfStatement extends BaseStatement {
|
||||
type: "IfStatement";
|
||||
test: Expression;
|
||||
consequent: Statement;
|
||||
alternate?: Statement | null | undefined;
|
||||
}
|
||||
|
||||
export interface LabeledStatement extends BaseStatement {
|
||||
type: "LabeledStatement";
|
||||
label: Identifier;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface BreakStatement extends BaseStatement {
|
||||
type: "BreakStatement";
|
||||
label?: Identifier | null | undefined;
|
||||
}
|
||||
|
||||
export interface ContinueStatement extends BaseStatement {
|
||||
type: "ContinueStatement";
|
||||
label?: Identifier | null | undefined;
|
||||
}
|
||||
|
||||
export interface WithStatement extends BaseStatement {
|
||||
type: "WithStatement";
|
||||
object: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface SwitchStatement extends BaseStatement {
|
||||
type: "SwitchStatement";
|
||||
discriminant: Expression;
|
||||
cases: SwitchCase[];
|
||||
}
|
||||
|
||||
export interface ReturnStatement extends BaseStatement {
|
||||
type: "ReturnStatement";
|
||||
argument?: Expression | null | undefined;
|
||||
}
|
||||
|
||||
export interface ThrowStatement extends BaseStatement {
|
||||
type: "ThrowStatement";
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
export interface TryStatement extends BaseStatement {
|
||||
type: "TryStatement";
|
||||
block: BlockStatement;
|
||||
handler?: CatchClause | null | undefined;
|
||||
finalizer?: BlockStatement | null | undefined;
|
||||
}
|
||||
|
||||
export interface WhileStatement extends BaseStatement {
|
||||
type: "WhileStatement";
|
||||
test: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface DoWhileStatement extends BaseStatement {
|
||||
type: "DoWhileStatement";
|
||||
body: Statement;
|
||||
test: Expression;
|
||||
}
|
||||
|
||||
export interface ForStatement extends BaseStatement {
|
||||
type: "ForStatement";
|
||||
init?: VariableDeclaration | Expression | null | undefined;
|
||||
test?: Expression | null | undefined;
|
||||
update?: Expression | null | undefined;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface BaseForXStatement extends BaseStatement {
|
||||
left: VariableDeclaration | Pattern;
|
||||
right: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface ForInStatement extends BaseForXStatement {
|
||||
type: "ForInStatement";
|
||||
}
|
||||
|
||||
export interface DebuggerStatement extends BaseStatement {
|
||||
type: "DebuggerStatement";
|
||||
}
|
||||
|
||||
export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
|
||||
|
||||
export interface BaseDeclaration extends BaseStatement {}
|
||||
|
||||
export interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
|
||||
type: "FunctionDeclaration";
|
||||
/** It is null when a function declaration is a part of the `export default function` statement */
|
||||
id: Identifier | null;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
export interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
export interface VariableDeclaration extends BaseDeclaration {
|
||||
type: "VariableDeclaration";
|
||||
declarations: VariableDeclarator[];
|
||||
kind: "var" | "let" | "const" | "using" | "await using";
|
||||
}
|
||||
|
||||
export interface VariableDeclarator extends BaseNode {
|
||||
type: "VariableDeclarator";
|
||||
id: Pattern;
|
||||
init?: Expression | null | undefined;
|
||||
}
|
||||
|
||||
export interface ExpressionMap {
|
||||
ArrayExpression: ArrayExpression;
|
||||
ArrowFunctionExpression: ArrowFunctionExpression;
|
||||
AssignmentExpression: AssignmentExpression;
|
||||
AwaitExpression: AwaitExpression;
|
||||
BinaryExpression: BinaryExpression;
|
||||
CallExpression: CallExpression;
|
||||
ChainExpression: ChainExpression;
|
||||
ClassExpression: ClassExpression;
|
||||
ConditionalExpression: ConditionalExpression;
|
||||
FunctionExpression: FunctionExpression;
|
||||
Identifier: Identifier;
|
||||
ImportExpression: ImportExpression;
|
||||
Literal: Literal;
|
||||
LogicalExpression: LogicalExpression;
|
||||
MemberExpression: MemberExpression;
|
||||
MetaProperty: MetaProperty;
|
||||
NewExpression: NewExpression;
|
||||
ObjectExpression: ObjectExpression;
|
||||
SequenceExpression: SequenceExpression;
|
||||
TaggedTemplateExpression: TaggedTemplateExpression;
|
||||
TemplateLiteral: TemplateLiteral;
|
||||
ThisExpression: ThisExpression;
|
||||
UnaryExpression: UnaryExpression;
|
||||
UpdateExpression: UpdateExpression;
|
||||
YieldExpression: YieldExpression;
|
||||
}
|
||||
|
||||
export type Expression = ExpressionMap[keyof ExpressionMap];
|
||||
|
||||
export interface BaseExpression extends BaseNode {}
|
||||
|
||||
export type ChainElement = SimpleCallExpression | MemberExpression;
|
||||
|
||||
export interface ChainExpression extends BaseExpression {
|
||||
type: "ChainExpression";
|
||||
expression: ChainElement;
|
||||
}
|
||||
|
||||
export interface ThisExpression extends BaseExpression {
|
||||
type: "ThisExpression";
|
||||
}
|
||||
|
||||
export interface ArrayExpression extends BaseExpression {
|
||||
type: "ArrayExpression";
|
||||
elements: Array<Expression | SpreadElement | null>;
|
||||
}
|
||||
|
||||
export interface ObjectExpression extends BaseExpression {
|
||||
type: "ObjectExpression";
|
||||
properties: Array<Property | SpreadElement>;
|
||||
}
|
||||
|
||||
export interface PrivateIdentifier extends BaseNode {
|
||||
type: "PrivateIdentifier";
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface Property extends BaseNode {
|
||||
type: "Property";
|
||||
key: Expression;
|
||||
value: Expression | Pattern; // Could be an AssignmentProperty
|
||||
kind: "init" | "get" | "set";
|
||||
method: boolean;
|
||||
shorthand: boolean;
|
||||
computed: boolean;
|
||||
}
|
||||
|
||||
export interface PropertyDefinition extends BaseNode {
|
||||
type: "PropertyDefinition";
|
||||
key: Expression | PrivateIdentifier;
|
||||
value?: Expression | null | undefined;
|
||||
computed: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
export interface FunctionExpression extends BaseFunction, BaseExpression {
|
||||
id?: Identifier | null | undefined;
|
||||
type: "FunctionExpression";
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
export interface SequenceExpression extends BaseExpression {
|
||||
type: "SequenceExpression";
|
||||
expressions: Expression[];
|
||||
}
|
||||
|
||||
export interface UnaryExpression extends BaseExpression {
|
||||
type: "UnaryExpression";
|
||||
operator: UnaryOperator;
|
||||
prefix: true;
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
export interface BinaryExpression extends BaseExpression {
|
||||
type: "BinaryExpression";
|
||||
operator: BinaryOperator;
|
||||
left: Expression | PrivateIdentifier;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export interface AssignmentExpression extends BaseExpression {
|
||||
type: "AssignmentExpression";
|
||||
operator: AssignmentOperator;
|
||||
left: Pattern | MemberExpression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export interface UpdateExpression extends BaseExpression {
|
||||
type: "UpdateExpression";
|
||||
operator: UpdateOperator;
|
||||
argument: Expression;
|
||||
prefix: boolean;
|
||||
}
|
||||
|
||||
export interface LogicalExpression extends BaseExpression {
|
||||
type: "LogicalExpression";
|
||||
operator: LogicalOperator;
|
||||
left: Expression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export interface ConditionalExpression extends BaseExpression {
|
||||
type: "ConditionalExpression";
|
||||
test: Expression;
|
||||
alternate: Expression;
|
||||
consequent: Expression;
|
||||
}
|
||||
|
||||
export interface BaseCallExpression extends BaseExpression {
|
||||
callee: Expression | Super;
|
||||
arguments: Array<Expression | SpreadElement>;
|
||||
}
|
||||
export type CallExpression = SimpleCallExpression | NewExpression;
|
||||
|
||||
export interface SimpleCallExpression extends BaseCallExpression {
|
||||
type: "CallExpression";
|
||||
optional: boolean;
|
||||
}
|
||||
|
||||
export interface NewExpression extends BaseCallExpression {
|
||||
type: "NewExpression";
|
||||
}
|
||||
|
||||
export interface MemberExpression extends BaseExpression, BasePattern {
|
||||
type: "MemberExpression";
|
||||
object: Expression | Super;
|
||||
property: Expression | PrivateIdentifier;
|
||||
computed: boolean;
|
||||
optional: boolean;
|
||||
}
|
||||
|
||||
export type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
|
||||
|
||||
export interface BasePattern extends BaseNode {}
|
||||
|
||||
export interface SwitchCase extends BaseNode {
|
||||
type: "SwitchCase";
|
||||
test?: Expression | null | undefined;
|
||||
consequent: Statement[];
|
||||
}
|
||||
|
||||
export interface CatchClause extends BaseNode {
|
||||
type: "CatchClause";
|
||||
param: Pattern | null;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
export interface Identifier extends BaseNode, BaseExpression, BasePattern {
|
||||
type: "Identifier";
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
|
||||
|
||||
export interface SimpleLiteral extends BaseNode, BaseExpression {
|
||||
type: "Literal";
|
||||
value: string | boolean | number | null;
|
||||
raw?: string | undefined;
|
||||
}
|
||||
|
||||
export interface RegExpLiteral extends BaseNode, BaseExpression {
|
||||
type: "Literal";
|
||||
value?: RegExp | null | undefined;
|
||||
regex: {
|
||||
pattern: string;
|
||||
flags: string;
|
||||
};
|
||||
raw?: string | undefined;
|
||||
}
|
||||
|
||||
export interface BigIntLiteral extends BaseNode, BaseExpression {
|
||||
type: "Literal";
|
||||
value?: bigint | null | undefined;
|
||||
bigint: string;
|
||||
raw?: string | undefined;
|
||||
}
|
||||
|
||||
export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
|
||||
|
||||
export type BinaryOperator =
|
||||
| "=="
|
||||
| "!="
|
||||
| "==="
|
||||
| "!=="
|
||||
| "<"
|
||||
| "<="
|
||||
| ">"
|
||||
| ">="
|
||||
| "<<"
|
||||
| ">>"
|
||||
| ">>>"
|
||||
| "+"
|
||||
| "-"
|
||||
| "*"
|
||||
| "/"
|
||||
| "%"
|
||||
| "**"
|
||||
| "|"
|
||||
| "^"
|
||||
| "&"
|
||||
| "in"
|
||||
| "instanceof";
|
||||
|
||||
export type LogicalOperator = "||" | "&&" | "??";
|
||||
|
||||
export type AssignmentOperator =
|
||||
| "="
|
||||
| "+="
|
||||
| "-="
|
||||
| "*="
|
||||
| "/="
|
||||
| "%="
|
||||
| "**="
|
||||
| "<<="
|
||||
| ">>="
|
||||
| ">>>="
|
||||
| "|="
|
||||
| "^="
|
||||
| "&="
|
||||
| "||="
|
||||
| "&&="
|
||||
| "??=";
|
||||
|
||||
export type UpdateOperator = "++" | "--";
|
||||
|
||||
export interface ForOfStatement extends BaseForXStatement {
|
||||
type: "ForOfStatement";
|
||||
await: boolean;
|
||||
}
|
||||
|
||||
export interface Super extends BaseNode {
|
||||
type: "Super";
|
||||
}
|
||||
|
||||
export interface SpreadElement extends BaseNode {
|
||||
type: "SpreadElement";
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
export interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
|
||||
type: "ArrowFunctionExpression";
|
||||
expression: boolean;
|
||||
body: BlockStatement | Expression;
|
||||
}
|
||||
|
||||
export interface YieldExpression extends BaseExpression {
|
||||
type: "YieldExpression";
|
||||
argument?: Expression | null | undefined;
|
||||
delegate: boolean;
|
||||
}
|
||||
|
||||
export interface TemplateLiteral extends BaseExpression {
|
||||
type: "TemplateLiteral";
|
||||
quasis: TemplateElement[];
|
||||
expressions: Expression[];
|
||||
}
|
||||
|
||||
export interface TaggedTemplateExpression extends BaseExpression {
|
||||
type: "TaggedTemplateExpression";
|
||||
tag: Expression;
|
||||
quasi: TemplateLiteral;
|
||||
}
|
||||
|
||||
export interface TemplateElement extends BaseNode {
|
||||
type: "TemplateElement";
|
||||
tail: boolean;
|
||||
value: {
|
||||
/** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */
|
||||
cooked?: string | null | undefined;
|
||||
raw: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AssignmentProperty extends Property {
|
||||
value: Pattern;
|
||||
kind: "init";
|
||||
method: boolean; // false
|
||||
}
|
||||
|
||||
export interface ObjectPattern extends BasePattern {
|
||||
type: "ObjectPattern";
|
||||
properties: Array<AssignmentProperty | RestElement>;
|
||||
}
|
||||
|
||||
export interface ArrayPattern extends BasePattern {
|
||||
type: "ArrayPattern";
|
||||
elements: Array<Pattern | null>;
|
||||
}
|
||||
|
||||
export interface RestElement extends BasePattern {
|
||||
type: "RestElement";
|
||||
argument: Pattern;
|
||||
}
|
||||
|
||||
export interface AssignmentPattern extends BasePattern {
|
||||
type: "AssignmentPattern";
|
||||
left: Pattern;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export type Class = ClassDeclaration | ClassExpression;
|
||||
export interface BaseClass extends BaseNode {
|
||||
superClass?: Expression | null | undefined;
|
||||
body: ClassBody;
|
||||
}
|
||||
|
||||
export interface ClassBody extends BaseNode {
|
||||
type: "ClassBody";
|
||||
body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
|
||||
}
|
||||
|
||||
export interface MethodDefinition extends BaseNode {
|
||||
type: "MethodDefinition";
|
||||
key: Expression | PrivateIdentifier;
|
||||
value: FunctionExpression;
|
||||
kind: "constructor" | "method" | "get" | "set";
|
||||
computed: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
export interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
|
||||
type: "ClassDeclaration";
|
||||
/** It is null when a class declaration is a part of the `export default class` statement */
|
||||
id: Identifier | null;
|
||||
}
|
||||
|
||||
export interface ClassDeclaration extends MaybeNamedClassDeclaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
export interface ClassExpression extends BaseClass, BaseExpression {
|
||||
type: "ClassExpression";
|
||||
id?: Identifier | null | undefined;
|
||||
}
|
||||
|
||||
export interface MetaProperty extends BaseExpression {
|
||||
type: "MetaProperty";
|
||||
meta: Identifier;
|
||||
property: Identifier;
|
||||
}
|
||||
|
||||
export type ModuleDeclaration =
|
||||
| ImportDeclaration
|
||||
| ExportNamedDeclaration
|
||||
| ExportDefaultDeclaration
|
||||
| ExportAllDeclaration;
|
||||
export interface BaseModuleDeclaration extends BaseNode {}
|
||||
|
||||
export type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
|
||||
export interface BaseModuleSpecifier extends BaseNode {
|
||||
local: Identifier;
|
||||
}
|
||||
|
||||
export interface ImportDeclaration extends BaseModuleDeclaration {
|
||||
type: "ImportDeclaration";
|
||||
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
|
||||
attributes: ImportAttribute[];
|
||||
source: Literal;
|
||||
}
|
||||
|
||||
export interface ImportSpecifier extends BaseModuleSpecifier {
|
||||
type: "ImportSpecifier";
|
||||
imported: Identifier | Literal;
|
||||
}
|
||||
|
||||
export interface ImportAttribute extends BaseNode {
|
||||
type: "ImportAttribute";
|
||||
key: Identifier | Literal;
|
||||
value: Literal;
|
||||
}
|
||||
|
||||
export interface ImportExpression extends BaseExpression {
|
||||
type: "ImportExpression";
|
||||
source: Expression;
|
||||
options?: Expression | null | undefined;
|
||||
}
|
||||
|
||||
export interface ImportDefaultSpecifier extends BaseModuleSpecifier {
|
||||
type: "ImportDefaultSpecifier";
|
||||
}
|
||||
|
||||
export interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
|
||||
type: "ImportNamespaceSpecifier";
|
||||
}
|
||||
|
||||
export interface ExportNamedDeclaration extends BaseModuleDeclaration {
|
||||
type: "ExportNamedDeclaration";
|
||||
declaration?: Declaration | null | undefined;
|
||||
specifiers: ExportSpecifier[];
|
||||
attributes: ImportAttribute[];
|
||||
source?: Literal | null | undefined;
|
||||
}
|
||||
|
||||
export interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
|
||||
type: "ExportSpecifier";
|
||||
local: Identifier | Literal;
|
||||
exported: Identifier | Literal;
|
||||
}
|
||||
|
||||
export interface ExportDefaultDeclaration extends BaseModuleDeclaration {
|
||||
type: "ExportDefaultDeclaration";
|
||||
declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
|
||||
}
|
||||
|
||||
export interface ExportAllDeclaration extends BaseModuleDeclaration {
|
||||
type: "ExportAllDeclaration";
|
||||
exported: Identifier | Literal | null;
|
||||
attributes: ImportAttribute[];
|
||||
source: Literal;
|
||||
}
|
||||
|
||||
export interface AwaitExpression extends BaseExpression {
|
||||
type: "AwaitExpression";
|
||||
argument: Expression;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@types/estree",
|
||||
"version": "1.0.9",
|
||||
"description": "TypeScript definitions for estree",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "RReverser",
|
||||
"githubUsername": "RReverser",
|
||||
"url": "https://github.com/RReverser"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/estree"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"peerDependencies": {},
|
||||
"typesPublisherContentHash": "db16da859cb0bee641414117047a4becba2e9f39d3e14a6745f887c47ef68482",
|
||||
"typeScriptVersion": "5.3",
|
||||
"nonNpm": true
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/hast`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for hast (https://github.com/syntax-tree/hast).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hast.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Thu, 09 Jul 2026 11:00:13 GMT
|
||||
* Dependencies: [@types/unist](https://npmjs.com/package/@types/unist)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [lukeggchapman](https://github.com/lukeggchapman), [Junyoung Choi](https://github.com/rokt33r), [Christian Murphy](https://github.com/ChristianMurphy), [Remco Haszing](https://github.com/remcohaszing), and [Titus Wormer](https://github.com/wooorm).
|
||||
+924
@@ -0,0 +1,924 @@
|
||||
import type { Data as UnistData, Literal as UnistLiteral, Node as UnistNode, Parent as UnistParent } from "unist";
|
||||
|
||||
// ## Interfaces
|
||||
|
||||
/**
|
||||
* Info associated with hast nodes by the ecosystem.
|
||||
*
|
||||
* This space is guaranteed to never be specified by unist or hast.
|
||||
* But you can use it in utilities and plugins to store data.
|
||||
*
|
||||
* This type can be augmented to register custom data.
|
||||
* For example:
|
||||
*
|
||||
* ```ts
|
||||
* declare module 'hast' {
|
||||
* interface Data {
|
||||
* // `someNode.data.myId` is typed as `number | undefined`
|
||||
* myId?: number | undefined
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export interface Data extends UnistData {}
|
||||
|
||||
/**
|
||||
* Info associated with an element.
|
||||
*/
|
||||
export interface Properties {
|
||||
abbr?: string | undefined;
|
||||
about?: Array<string> | undefined;
|
||||
accentHeight?: number | string | undefined;
|
||||
accept?: Array<string> | undefined;
|
||||
acceptCharset?: Array<string> | undefined;
|
||||
accessKey?: Array<string> | undefined;
|
||||
accumulate?: string | undefined;
|
||||
action?: string | undefined;
|
||||
additive?: string | undefined;
|
||||
align?: string | undefined;
|
||||
alignmentBaseline?: string | undefined;
|
||||
aLink?: string | undefined;
|
||||
allow?: string | undefined;
|
||||
allowFullScreen?: boolean | string | undefined;
|
||||
allowPaymentRequest?: boolean | string | undefined;
|
||||
allowTransparency?: string | undefined;
|
||||
allowUserMedia?: boolean | string | undefined;
|
||||
alpha?: boolean | string | undefined;
|
||||
alphabetic?: number | string | undefined;
|
||||
alt?: string | undefined;
|
||||
amplitude?: number | string | undefined;
|
||||
arabicForm?: string | undefined;
|
||||
archive?: Array<string> | undefined;
|
||||
ariaActiveDescendant?: string | undefined;
|
||||
ariaAtomic?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaAutoComplete?: string | undefined;
|
||||
ariaBusy?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaChecked?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaColCount?: number | string | undefined;
|
||||
ariaColIndex?: number | string | undefined;
|
||||
ariaColSpan?: number | string | undefined;
|
||||
ariaControls?: Array<string> | undefined;
|
||||
ariaCurrent?: string | undefined;
|
||||
ariaDescribedBy?: Array<string> | undefined;
|
||||
ariaDetails?: string | undefined;
|
||||
ariaDisabled?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaDropEffect?: Array<string> | undefined;
|
||||
ariaErrorMessage?: string | undefined;
|
||||
ariaExpanded?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaFlowTo?: Array<string> | undefined;
|
||||
ariaGrabbed?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaHasPopup?: string | undefined;
|
||||
ariaHidden?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaInvalid?: string | undefined;
|
||||
ariaKeyShortcuts?: string | undefined;
|
||||
ariaLabel?: string | undefined;
|
||||
ariaLabelledBy?: Array<string> | undefined;
|
||||
ariaLevel?: number | string | undefined;
|
||||
ariaLive?: string | undefined;
|
||||
ariaModal?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaMultiLine?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaMultiSelectable?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaOrientation?: string | undefined;
|
||||
ariaOwns?: Array<string> | undefined;
|
||||
ariaPlaceholder?: string | undefined;
|
||||
ariaPosInSet?: number | string | undefined;
|
||||
ariaPressed?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaReadOnly?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaRelevant?: string | undefined;
|
||||
ariaRequired?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaRoleDescription?: Array<string> | undefined;
|
||||
ariaRowCount?: number | string | undefined;
|
||||
ariaRowIndex?: number | string | undefined;
|
||||
ariaRowSpan?: number | string | undefined;
|
||||
ariaSelected?: "false" | "true" | (string & {}) | undefined;
|
||||
ariaSetSize?: number | string | undefined;
|
||||
ariaSort?: string | undefined;
|
||||
ariaValueMax?: number | string | undefined;
|
||||
ariaValueMin?: number | string | undefined;
|
||||
ariaValueNow?: number | string | undefined;
|
||||
ariaValueText?: string | undefined;
|
||||
as?: string | undefined;
|
||||
ascent?: number | string | undefined;
|
||||
async?: boolean | string | undefined;
|
||||
attributeName?: string | undefined;
|
||||
attributeType?: string | undefined;
|
||||
autoCapitalize?: string | undefined;
|
||||
autoComplete?: Array<string> | undefined;
|
||||
autoCorrect?: string | undefined;
|
||||
autoFocus?: boolean | string | undefined;
|
||||
autoPlay?: boolean | string | undefined;
|
||||
autoSave?: string | undefined;
|
||||
axis?: string | undefined;
|
||||
azimuth?: number | string | undefined;
|
||||
background?: string | undefined;
|
||||
bandwidth?: string | undefined;
|
||||
baseFrequency?: string | undefined;
|
||||
baselineShift?: string | undefined;
|
||||
baseProfile?: string | undefined;
|
||||
bbox?: string | undefined;
|
||||
begin?: string | undefined;
|
||||
bgColor?: string | undefined;
|
||||
bias?: number | string | undefined;
|
||||
blocking?: Array<string> | undefined;
|
||||
border?: number | string | undefined;
|
||||
borderColor?: string | undefined;
|
||||
bottomMargin?: number | string | undefined;
|
||||
by?: string | undefined;
|
||||
calcMode?: string | undefined;
|
||||
capHeight?: number | string | undefined;
|
||||
capture?: string | undefined;
|
||||
cellPadding?: string | undefined;
|
||||
cellSpacing?: string | undefined;
|
||||
char?: string | undefined;
|
||||
charOff?: string | undefined;
|
||||
charSet?: string | undefined;
|
||||
checked?: boolean | string | undefined;
|
||||
cite?: string | undefined;
|
||||
classId?: string | undefined;
|
||||
className?: Array<string> | undefined;
|
||||
clear?: string | undefined;
|
||||
clip?: string | undefined;
|
||||
clipPath?: string | undefined;
|
||||
clipPathUnits?: string | undefined;
|
||||
clipRule?: string | undefined;
|
||||
closedBy?: string | undefined;
|
||||
code?: string | undefined;
|
||||
codeBase?: string | undefined;
|
||||
codeType?: string | undefined;
|
||||
color?: string | undefined;
|
||||
colorInterpolation?: string | undefined;
|
||||
colorInterpolationFilters?: string | undefined;
|
||||
colorProfile?: string | undefined;
|
||||
colorRendering?: string | undefined;
|
||||
colorSpace?: string | undefined;
|
||||
cols?: number | string | undefined;
|
||||
colSpan?: number | string | undefined;
|
||||
command?: string | undefined;
|
||||
commandFor?: string | undefined;
|
||||
compact?: boolean | string | undefined;
|
||||
content?: string | undefined;
|
||||
contentEditable?: "false" | "true" | (string & {}) | undefined;
|
||||
contentScriptType?: string | undefined;
|
||||
contentStyleType?: string | undefined;
|
||||
controls?: boolean | string | undefined;
|
||||
controlsList?: Array<string> | undefined;
|
||||
coords?: Array<number | string> | undefined;
|
||||
credentialless?: boolean | string | undefined;
|
||||
crossOrigin?: string | undefined;
|
||||
cursor?: string | undefined;
|
||||
cx?: string | undefined;
|
||||
cy?: string | undefined;
|
||||
d?: string | undefined;
|
||||
data?: string | undefined;
|
||||
dataType?: string | undefined;
|
||||
dateTime?: string | undefined;
|
||||
declare?: boolean | string | undefined;
|
||||
decoding?: string | undefined;
|
||||
default?: boolean | string | undefined;
|
||||
defaultAction?: string | undefined;
|
||||
defer?: boolean | string | undefined;
|
||||
descent?: number | string | undefined;
|
||||
diffuseConstant?: number | string | undefined;
|
||||
dir?: string | undefined;
|
||||
direction?: string | undefined;
|
||||
dirName?: string | undefined;
|
||||
disabled?: boolean | string | undefined;
|
||||
disablePictureInPicture?: boolean | string | undefined;
|
||||
disableRemotePlayback?: boolean | string | undefined;
|
||||
display?: string | undefined;
|
||||
divisor?: number | string | undefined;
|
||||
dominantBaseline?: string | undefined;
|
||||
download?: boolean | string | undefined;
|
||||
draggable?: "false" | "true" | (string & {}) | undefined;
|
||||
dur?: string | undefined;
|
||||
dx?: string | undefined;
|
||||
dy?: string | undefined;
|
||||
edgeMode?: string | undefined;
|
||||
editable?: string | undefined;
|
||||
elevation?: number | string | undefined;
|
||||
enableBackground?: string | undefined;
|
||||
encType?: string | undefined;
|
||||
end?: string | undefined;
|
||||
enterKeyHint?: string | undefined;
|
||||
event?: string | undefined;
|
||||
exponent?: number | string | undefined;
|
||||
exportParts?: Array<string> | undefined;
|
||||
externalResourcesRequired?: string | undefined;
|
||||
face?: string | undefined;
|
||||
fetchPriority?: string | undefined;
|
||||
fill?: string | undefined;
|
||||
fillOpacity?: number | string | undefined;
|
||||
fillRule?: string | undefined;
|
||||
filter?: string | undefined;
|
||||
filterRes?: string | undefined;
|
||||
filterUnits?: string | undefined;
|
||||
floodColor?: string | undefined;
|
||||
floodOpacity?: string | undefined;
|
||||
focusable?: string | undefined;
|
||||
focusHighlight?: string | undefined;
|
||||
fontFamily?: string | undefined;
|
||||
fontSize?: string | undefined;
|
||||
fontSizeAdjust?: string | undefined;
|
||||
fontStretch?: string | undefined;
|
||||
fontStyle?: string | undefined;
|
||||
fontVariant?: string | undefined;
|
||||
fontWeight?: string | undefined;
|
||||
form?: string | undefined;
|
||||
formAction?: string | undefined;
|
||||
format?: string | undefined;
|
||||
formEncType?: string | undefined;
|
||||
formMethod?: string | undefined;
|
||||
formNoValidate?: boolean | string | undefined;
|
||||
formTarget?: string | undefined;
|
||||
fr?: string | undefined;
|
||||
frame?: string | undefined;
|
||||
frameBorder?: string | undefined;
|
||||
from?: string | undefined;
|
||||
fx?: string | undefined;
|
||||
fy?: string | undefined;
|
||||
g1?: Array<string> | undefined;
|
||||
g2?: Array<string> | undefined;
|
||||
glyphName?: Array<string> | undefined;
|
||||
glyphOrientationHorizontal?: string | undefined;
|
||||
glyphOrientationVertical?: string | undefined;
|
||||
glyphRef?: string | undefined;
|
||||
gradientTransform?: string | undefined;
|
||||
gradientUnits?: string | undefined;
|
||||
handler?: string | undefined;
|
||||
hanging?: number | string | undefined;
|
||||
hatchContentUnits?: string | undefined;
|
||||
hatchUnits?: string | undefined;
|
||||
headers?: Array<string> | undefined;
|
||||
height?: number | string | undefined;
|
||||
hidden?: boolean | string | undefined;
|
||||
high?: number | string | undefined;
|
||||
horizAdvX?: number | string | undefined;
|
||||
horizOriginX?: number | string | undefined;
|
||||
horizOriginY?: number | string | undefined;
|
||||
href?: string | undefined;
|
||||
hrefLang?: string | undefined;
|
||||
hSpace?: number | string | undefined;
|
||||
htmlFor?: Array<string> | undefined;
|
||||
httpEquiv?: Array<string> | undefined;
|
||||
id?: string | undefined;
|
||||
ideographic?: number | string | undefined;
|
||||
imageRendering?: string | undefined;
|
||||
imageSizes?: string | undefined;
|
||||
imageSrcSet?: string | undefined;
|
||||
in?: string | undefined;
|
||||
in2?: string | undefined;
|
||||
inert?: boolean | string | undefined;
|
||||
initialVisibility?: string | undefined;
|
||||
inputMode?: string | undefined;
|
||||
integrity?: string | undefined;
|
||||
intercept?: number | string | undefined;
|
||||
is?: string | undefined;
|
||||
isMap?: boolean | string | undefined;
|
||||
itemId?: string | undefined;
|
||||
itemProp?: Array<string> | undefined;
|
||||
itemRef?: Array<string> | undefined;
|
||||
itemScope?: boolean | string | undefined;
|
||||
itemType?: Array<string> | undefined;
|
||||
k?: number | string | undefined;
|
||||
k1?: number | string | undefined;
|
||||
k2?: number | string | undefined;
|
||||
k3?: number | string | undefined;
|
||||
k4?: number | string | undefined;
|
||||
kernelMatrix?: Array<string> | undefined;
|
||||
kernelUnitLength?: string | undefined;
|
||||
kerning?: string | undefined;
|
||||
keyPoints?: string | undefined;
|
||||
keySplines?: string | undefined;
|
||||
keyTimes?: string | undefined;
|
||||
kind?: string | undefined;
|
||||
label?: string | undefined;
|
||||
lang?: string | undefined;
|
||||
language?: string | undefined;
|
||||
leftMargin?: number | string | undefined;
|
||||
lengthAdjust?: string | undefined;
|
||||
letterSpacing?: string | undefined;
|
||||
lightingColor?: string | undefined;
|
||||
limitingConeAngle?: number | string | undefined;
|
||||
link?: string | undefined;
|
||||
list?: string | undefined;
|
||||
loading?: string | undefined;
|
||||
local?: string | undefined;
|
||||
longDesc?: string | undefined;
|
||||
loop?: boolean | string | undefined;
|
||||
low?: number | string | undefined;
|
||||
lowSrc?: string | undefined;
|
||||
manifest?: string | undefined;
|
||||
marginHeight?: number | string | undefined;
|
||||
marginWidth?: number | string | undefined;
|
||||
markerEnd?: string | undefined;
|
||||
markerHeight?: string | undefined;
|
||||
markerMid?: string | undefined;
|
||||
markerStart?: string | undefined;
|
||||
markerUnits?: string | undefined;
|
||||
markerWidth?: string | undefined;
|
||||
mask?: string | undefined;
|
||||
maskContentUnits?: string | undefined;
|
||||
maskType?: string | undefined;
|
||||
maskUnits?: string | undefined;
|
||||
mathematical?: string | undefined;
|
||||
max?: string | undefined;
|
||||
maxLength?: number | string | undefined;
|
||||
media?: string | undefined;
|
||||
mediaCharacterEncoding?: string | undefined;
|
||||
mediaContentEncodings?: string | undefined;
|
||||
mediaSize?: number | string | undefined;
|
||||
mediaTime?: string | undefined;
|
||||
method?: string | undefined;
|
||||
min?: string | undefined;
|
||||
minLength?: number | string | undefined;
|
||||
mode?: string | undefined;
|
||||
multiple?: boolean | string | undefined;
|
||||
muted?: boolean | string | undefined;
|
||||
name?: string | undefined;
|
||||
navDown?: string | undefined;
|
||||
navDownLeft?: string | undefined;
|
||||
navDownRight?: string | undefined;
|
||||
navLeft?: string | undefined;
|
||||
navNext?: string | undefined;
|
||||
navPrev?: string | undefined;
|
||||
navRight?: string | undefined;
|
||||
navUp?: string | undefined;
|
||||
navUpLeft?: string | undefined;
|
||||
navUpRight?: string | undefined;
|
||||
noHref?: boolean | string | undefined;
|
||||
noModule?: boolean | string | undefined;
|
||||
nonce?: string | undefined;
|
||||
noResize?: boolean | string | undefined;
|
||||
noShade?: boolean | string | undefined;
|
||||
noValidate?: boolean | string | undefined;
|
||||
noWrap?: boolean | string | undefined;
|
||||
numOctaves?: string | undefined;
|
||||
object?: string | undefined;
|
||||
observer?: string | undefined;
|
||||
offset?: string | undefined;
|
||||
onAbort?: string | undefined;
|
||||
onActivate?: string | undefined;
|
||||
onAfterPrint?: string | undefined;
|
||||
onAuxClick?: string | undefined;
|
||||
onBeforeMatch?: string | undefined;
|
||||
onBeforePrint?: string | undefined;
|
||||
onBeforeToggle?: string | undefined;
|
||||
onBeforeUnload?: string | undefined;
|
||||
onBegin?: string | undefined;
|
||||
onBlur?: string | undefined;
|
||||
onCancel?: string | undefined;
|
||||
onCanPlay?: string | undefined;
|
||||
onCanPlayThrough?: string | undefined;
|
||||
onChange?: string | undefined;
|
||||
onClick?: string | undefined;
|
||||
onClose?: string | undefined;
|
||||
onContextLost?: string | undefined;
|
||||
onContextMenu?: string | undefined;
|
||||
onContextRestored?: string | undefined;
|
||||
onCopy?: string | undefined;
|
||||
onCueChange?: string | undefined;
|
||||
onCut?: string | undefined;
|
||||
onDblClick?: string | undefined;
|
||||
onDrag?: string | undefined;
|
||||
onDragEnd?: string | undefined;
|
||||
onDragEnter?: string | undefined;
|
||||
onDragExit?: string | undefined;
|
||||
onDragLeave?: string | undefined;
|
||||
onDragOver?: string | undefined;
|
||||
onDragStart?: string | undefined;
|
||||
onDrop?: string | undefined;
|
||||
onDurationChange?: string | undefined;
|
||||
onEmptied?: string | undefined;
|
||||
onEnd?: string | undefined;
|
||||
onEnded?: string | undefined;
|
||||
onError?: string | undefined;
|
||||
onFocus?: string | undefined;
|
||||
onFocusIn?: string | undefined;
|
||||
onFocusOut?: string | undefined;
|
||||
onFormData?: string | undefined;
|
||||
onHashChange?: string | undefined;
|
||||
onInput?: string | undefined;
|
||||
onInvalid?: string | undefined;
|
||||
onKeyDown?: string | undefined;
|
||||
onKeyPress?: string | undefined;
|
||||
onKeyUp?: string | undefined;
|
||||
onLanguageChange?: string | undefined;
|
||||
onLoad?: string | undefined;
|
||||
onLoadedData?: string | undefined;
|
||||
onLoadedMetadata?: string | undefined;
|
||||
onLoadEnd?: string | undefined;
|
||||
onLoadStart?: string | undefined;
|
||||
onMessage?: string | undefined;
|
||||
onMessageError?: string | undefined;
|
||||
onMouseDown?: string | undefined;
|
||||
onMouseEnter?: string | undefined;
|
||||
onMouseLeave?: string | undefined;
|
||||
onMouseMove?: string | undefined;
|
||||
onMouseOut?: string | undefined;
|
||||
onMouseOver?: string | undefined;
|
||||
onMouseUp?: string | undefined;
|
||||
onMouseWheel?: string | undefined;
|
||||
onOffline?: string | undefined;
|
||||
onOnline?: string | undefined;
|
||||
onPageHide?: string | undefined;
|
||||
onPageShow?: string | undefined;
|
||||
onPaste?: string | undefined;
|
||||
onPause?: string | undefined;
|
||||
onPlay?: string | undefined;
|
||||
onPlaying?: string | undefined;
|
||||
onPopState?: string | undefined;
|
||||
onProgress?: string | undefined;
|
||||
onRateChange?: string | undefined;
|
||||
onRejectionHandled?: string | undefined;
|
||||
onRepeat?: string | undefined;
|
||||
onReset?: string | undefined;
|
||||
onResize?: string | undefined;
|
||||
onScroll?: string | undefined;
|
||||
onScrollEnd?: string | undefined;
|
||||
onSecurityPolicyViolation?: string | undefined;
|
||||
onSeeked?: string | undefined;
|
||||
onSeeking?: string | undefined;
|
||||
onSelect?: string | undefined;
|
||||
onShow?: string | undefined;
|
||||
onSlotChange?: string | undefined;
|
||||
onStalled?: string | undefined;
|
||||
onStorage?: string | undefined;
|
||||
onSubmit?: string | undefined;
|
||||
onSuspend?: string | undefined;
|
||||
onTimeUpdate?: string | undefined;
|
||||
onToggle?: string | undefined;
|
||||
onUnhandledRejection?: string | undefined;
|
||||
onUnload?: string | undefined;
|
||||
onVolumeChange?: string | undefined;
|
||||
onWaiting?: string | undefined;
|
||||
onWheel?: string | undefined;
|
||||
onZoom?: string | undefined;
|
||||
opacity?: string | undefined;
|
||||
open?: boolean | string | undefined;
|
||||
operator?: string | undefined;
|
||||
optimum?: number | string | undefined;
|
||||
order?: string | undefined;
|
||||
orient?: string | undefined;
|
||||
orientation?: string | undefined;
|
||||
origin?: string | undefined;
|
||||
overflow?: string | undefined;
|
||||
overlay?: string | undefined;
|
||||
overlinePosition?: number | string | undefined;
|
||||
overlineThickness?: number | string | undefined;
|
||||
paintOrder?: string | undefined;
|
||||
panose1?: string | undefined;
|
||||
part?: Array<string> | undefined;
|
||||
path?: string | undefined;
|
||||
pathLength?: number | string | undefined;
|
||||
pattern?: string | undefined;
|
||||
patternContentUnits?: string | undefined;
|
||||
patternTransform?: string | undefined;
|
||||
patternUnits?: string | undefined;
|
||||
phase?: string | undefined;
|
||||
ping?: Array<string> | undefined;
|
||||
pitch?: string | undefined;
|
||||
placeholder?: string | undefined;
|
||||
playbackOrder?: string | undefined;
|
||||
playsInline?: boolean | string | undefined;
|
||||
pointerEvents?: string | undefined;
|
||||
points?: string | undefined;
|
||||
pointsAtX?: number | string | undefined;
|
||||
pointsAtY?: number | string | undefined;
|
||||
pointsAtZ?: number | string | undefined;
|
||||
popover?: string | undefined;
|
||||
popoverTarget?: string | undefined;
|
||||
popoverTargetAction?: string | undefined;
|
||||
poster?: string | undefined;
|
||||
prefix?: string | undefined;
|
||||
preload?: string | undefined;
|
||||
preserveAlpha?: string | undefined;
|
||||
preserveAspectRatio?: string | undefined;
|
||||
primitiveUnits?: string | undefined;
|
||||
profile?: string | undefined;
|
||||
prompt?: string | undefined;
|
||||
propagate?: string | undefined;
|
||||
property?: string | Array<string> | undefined;
|
||||
r?: string | undefined;
|
||||
radius?: string | undefined;
|
||||
readOnly?: boolean | string | undefined;
|
||||
referrerPolicy?: string | undefined;
|
||||
refX?: string | undefined;
|
||||
refY?: string | undefined;
|
||||
rel?: Array<string> | undefined;
|
||||
renderingIntent?: string | undefined;
|
||||
repeatCount?: string | undefined;
|
||||
repeatDur?: string | undefined;
|
||||
required?: boolean | string | undefined;
|
||||
requiredExtensions?: Array<string> | undefined;
|
||||
requiredFeatures?: Array<string> | undefined;
|
||||
requiredFonts?: Array<string> | undefined;
|
||||
requiredFormats?: Array<string> | undefined;
|
||||
resource?: string | undefined;
|
||||
restart?: string | undefined;
|
||||
result?: string | undefined;
|
||||
results?: number | string | undefined;
|
||||
rev?: string | Array<string> | undefined;
|
||||
reversed?: boolean | string | undefined;
|
||||
rightMargin?: number | string | undefined;
|
||||
role?: string | undefined;
|
||||
rotate?: string | undefined;
|
||||
rows?: number | string | undefined;
|
||||
rowSpan?: number | string | undefined;
|
||||
rules?: string | undefined;
|
||||
rx?: string | undefined;
|
||||
ry?: string | undefined;
|
||||
sandbox?: Array<string> | undefined;
|
||||
scale?: string | undefined;
|
||||
scheme?: string | undefined;
|
||||
scope?: string | undefined;
|
||||
scoped?: boolean | string | undefined;
|
||||
scrolling?: "false" | "true" | (string & {}) | undefined;
|
||||
seamless?: boolean | string | undefined;
|
||||
security?: string | undefined;
|
||||
seed?: string | undefined;
|
||||
selected?: boolean | string | undefined;
|
||||
shadowRootClonable?: boolean | string | undefined;
|
||||
shadowRootCustomElementRegistry?: boolean | string | undefined;
|
||||
shadowRootDelegatesFocus?: boolean | string | undefined;
|
||||
shadowRootMode?: string | undefined;
|
||||
shadowRootSerializable?: boolean | string | undefined;
|
||||
shape?: string | undefined;
|
||||
shapeRendering?: string | undefined;
|
||||
side?: string | undefined;
|
||||
size?: number | string | undefined;
|
||||
sizes?: string | undefined;
|
||||
slope?: string | undefined;
|
||||
slot?: string | undefined;
|
||||
snapshotTime?: string | undefined;
|
||||
spacing?: string | undefined;
|
||||
span?: number | string | undefined;
|
||||
specularConstant?: number | string | undefined;
|
||||
specularExponent?: number | string | undefined;
|
||||
spellCheck?: "false" | "true" | (string & {}) | undefined;
|
||||
spreadMethod?: string | undefined;
|
||||
src?: string | undefined;
|
||||
srcDoc?: string | undefined;
|
||||
srcLang?: string | undefined;
|
||||
srcSet?: string | undefined;
|
||||
standby?: string | undefined;
|
||||
start?: number | string | undefined;
|
||||
startOffset?: string | undefined;
|
||||
stdDeviation?: string | undefined;
|
||||
stemh?: string | undefined;
|
||||
stemv?: string | undefined;
|
||||
step?: string | undefined;
|
||||
stitchTiles?: string | undefined;
|
||||
stopColor?: string | undefined;
|
||||
stopOpacity?: string | undefined;
|
||||
strikethroughPosition?: number | string | undefined;
|
||||
strikethroughThickness?: number | string | undefined;
|
||||
string?: string | undefined;
|
||||
stroke?: string | undefined;
|
||||
strokeDashArray?: Array<string> | undefined;
|
||||
strokeDashOffset?: string | undefined;
|
||||
strokeLineCap?: string | undefined;
|
||||
strokeLineJoin?: string | undefined;
|
||||
strokeMiterLimit?: number | string | undefined;
|
||||
strokeOpacity?: number | string | undefined;
|
||||
strokeWidth?: string | undefined;
|
||||
style?: string | undefined;
|
||||
summary?: string | undefined;
|
||||
surfaceScale?: number | string | undefined;
|
||||
syncBehavior?: string | undefined;
|
||||
syncBehaviorDefault?: string | undefined;
|
||||
syncMaster?: string | undefined;
|
||||
syncTolerance?: string | undefined;
|
||||
syncToleranceDefault?: string | undefined;
|
||||
systemLanguage?: Array<string> | undefined;
|
||||
tabIndex?: number | string | undefined;
|
||||
tableValues?: string | undefined;
|
||||
target?: string | undefined;
|
||||
targetX?: number | string | undefined;
|
||||
targetY?: number | string | undefined;
|
||||
text?: string | undefined;
|
||||
textAnchor?: string | undefined;
|
||||
textDecoration?: string | undefined;
|
||||
textLength?: string | undefined;
|
||||
textRendering?: string | undefined;
|
||||
timelineBegin?: string | undefined;
|
||||
title?: string | undefined;
|
||||
to?: string | undefined;
|
||||
topMargin?: number | string | undefined;
|
||||
transform?: string | undefined;
|
||||
transformBehavior?: string | undefined;
|
||||
transformOrigin?: string | undefined;
|
||||
translate?: string | undefined;
|
||||
type?: string | undefined;
|
||||
typeMustMatch?: boolean | string | undefined;
|
||||
typeOf?: Array<string> | undefined;
|
||||
u1?: string | undefined;
|
||||
u2?: string | undefined;
|
||||
underlinePosition?: number | string | undefined;
|
||||
underlineThickness?: number | string | undefined;
|
||||
unicode?: string | undefined;
|
||||
unicodeBidi?: string | undefined;
|
||||
unicodeRange?: string | undefined;
|
||||
unitsPerEm?: number | string | undefined;
|
||||
unselectable?: string | undefined;
|
||||
useMap?: string | undefined;
|
||||
vAlign?: string | undefined;
|
||||
vAlphabetic?: number | string | undefined;
|
||||
value?: "false" | "true" | (string & {}) | undefined;
|
||||
values?: string | undefined;
|
||||
valueType?: string | undefined;
|
||||
vectorEffect?: string | undefined;
|
||||
version?: string | undefined;
|
||||
vertAdvY?: number | string | undefined;
|
||||
vertOriginX?: number | string | undefined;
|
||||
vertOriginY?: number | string | undefined;
|
||||
vHanging?: number | string | undefined;
|
||||
vIdeographic?: number | string | undefined;
|
||||
viewBox?: string | undefined;
|
||||
viewTarget?: string | undefined;
|
||||
visibility?: string | undefined;
|
||||
vLink?: string | undefined;
|
||||
vMathematical?: number | string | undefined;
|
||||
vSpace?: number | string | undefined;
|
||||
width?: number | string | undefined;
|
||||
widths?: string | undefined;
|
||||
wordSpacing?: string | undefined;
|
||||
wrap?: string | undefined;
|
||||
writingMode?: string | undefined;
|
||||
writingSuggestions?: string | undefined;
|
||||
x?: string | undefined;
|
||||
x1?: string | undefined;
|
||||
x2?: string | undefined;
|
||||
xChannelSelector?: string | undefined;
|
||||
xHeight?: number | string | undefined;
|
||||
xLinkActuate?: string | undefined;
|
||||
xLinkArcRole?: string | undefined;
|
||||
xLinkHref?: string | undefined;
|
||||
xLinkRole?: string | undefined;
|
||||
xLinkShow?: string | undefined;
|
||||
xLinkTitle?: string | undefined;
|
||||
xLinkType?: string | undefined;
|
||||
xmlBase?: string | undefined;
|
||||
xmlLang?: string | undefined;
|
||||
xmlns?: string | undefined;
|
||||
xmlnsXLink?: string | undefined;
|
||||
xmlSpace?: string | undefined;
|
||||
y?: string | undefined;
|
||||
y1?: string | undefined;
|
||||
y2?: string | undefined;
|
||||
yChannelSelector?: string | undefined;
|
||||
z?: string | undefined;
|
||||
zoomAndPan?: string | undefined;
|
||||
[PropertyName: string]: boolean | number | string | null | undefined | Array<string | number>;
|
||||
}
|
||||
|
||||
// ## Content maps
|
||||
|
||||
/**
|
||||
* Union of registered hast nodes that can occur in {@link Element}.
|
||||
*
|
||||
* To register mote custom hast nodes, add them to {@link ElementContentMap}.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type ElementContent = ElementContentMap[keyof ElementContentMap];
|
||||
|
||||
/**
|
||||
* Registry of all hast nodes that can occur as children of {@link Element}.
|
||||
*
|
||||
* For a union of all {@link Element} children, see {@link ElementContent}.
|
||||
*/
|
||||
export interface ElementContentMap {
|
||||
comment: Comment;
|
||||
element: Element;
|
||||
text: Text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Union of registered hast nodes that can occur in {@link Root}.
|
||||
*
|
||||
* To register custom hast nodes, add them to {@link RootContentMap}.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type RootContent = RootContentMap[keyof RootContentMap];
|
||||
|
||||
/**
|
||||
* Registry of all hast nodes that can occur as children of {@link Root}.
|
||||
*
|
||||
* > 👉 **Note**: {@link Root} does not need to be an entire document.
|
||||
* > it can also be a fragment.
|
||||
*
|
||||
* For a union of all {@link Root} children, see {@link RootContent}.
|
||||
*/
|
||||
export interface RootContentMap {
|
||||
comment: Comment;
|
||||
doctype: Doctype;
|
||||
element: Element;
|
||||
text: Text;
|
||||
}
|
||||
|
||||
// ### Special content types
|
||||
|
||||
/**
|
||||
* Union of registered hast nodes that can occur in {@link Root}.
|
||||
*
|
||||
* @deprecated Use {@link RootContent} instead.
|
||||
*/
|
||||
export type Content = RootContent;
|
||||
|
||||
/**
|
||||
* Union of registered hast literals.
|
||||
*
|
||||
* To register custom hast nodes, add them to {@link RootContentMap} and other
|
||||
* places where relevant.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type Literals = Extract<Nodes, UnistLiteral>;
|
||||
|
||||
/**
|
||||
* Union of registered hast nodes.
|
||||
*
|
||||
* To register custom hast nodes, add them to {@link RootContentMap} and other
|
||||
* places where relevant.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type Nodes = Root | RootContent;
|
||||
|
||||
/**
|
||||
* Union of registered hast parents.
|
||||
*
|
||||
* To register custom hast nodes, add them to {@link RootContentMap} and other
|
||||
* places where relevant.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type Parents = Extract<Nodes, UnistParent>;
|
||||
|
||||
// ## Abstract nodes
|
||||
|
||||
/**
|
||||
* Abstract hast node.
|
||||
*
|
||||
* This interface is supposed to be extended.
|
||||
* If you can use {@link Literal} or {@link Parent}, you should.
|
||||
* But for example in HTML, a `Doctype` is neither literal nor parent, but
|
||||
* still a node.
|
||||
*
|
||||
* To register custom hast nodes, add them to {@link RootContentMap} and other
|
||||
* places where relevant (such as {@link ElementContentMap}).
|
||||
*
|
||||
* For a union of all registered hast nodes, see {@link Nodes}.
|
||||
*/
|
||||
export interface Node extends UnistNode {
|
||||
/**
|
||||
* Info from the ecosystem.
|
||||
*/
|
||||
data?: Data | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract hast node that contains the smallest possible value.
|
||||
*
|
||||
* This interface is supposed to be extended if you make custom hast nodes.
|
||||
*
|
||||
* For a union of all registered hast literals, see {@link Literals}.
|
||||
*/
|
||||
export interface Literal extends Node {
|
||||
/**
|
||||
* Plain-text value.
|
||||
*/
|
||||
value: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract hast node that contains other hast nodes (*children*).
|
||||
*
|
||||
* This interface is supposed to be extended if you make custom hast nodes.
|
||||
*
|
||||
* For a union of all registered hast parents, see {@link Parents}.
|
||||
*/
|
||||
export interface Parent extends Node {
|
||||
/**
|
||||
* List of children.
|
||||
*/
|
||||
children: RootContent[];
|
||||
}
|
||||
|
||||
// ## Concrete nodes
|
||||
|
||||
/**
|
||||
* HTML comment.
|
||||
*/
|
||||
export interface Comment extends Literal {
|
||||
/**
|
||||
* Node type of HTML comments in hast.
|
||||
*/
|
||||
type: "comment";
|
||||
/**
|
||||
* Data associated with the comment.
|
||||
*/
|
||||
data?: CommentData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with hast comments by the ecosystem.
|
||||
*/
|
||||
export interface CommentData extends Data {}
|
||||
|
||||
/**
|
||||
* HTML document type.
|
||||
*/
|
||||
export interface Doctype extends UnistNode {
|
||||
/**
|
||||
* Node type of HTML document types in hast.
|
||||
*/
|
||||
type: "doctype";
|
||||
/**
|
||||
* Data associated with the doctype.
|
||||
*/
|
||||
data?: DoctypeData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with hast doctypes by the ecosystem.
|
||||
*/
|
||||
export interface DoctypeData extends Data {}
|
||||
|
||||
/**
|
||||
* HTML element.
|
||||
*/
|
||||
export interface Element extends Parent {
|
||||
/**
|
||||
* Node type of elements.
|
||||
*/
|
||||
type: "element";
|
||||
/**
|
||||
* Tag name (such as `'body'`) of the element.
|
||||
*/
|
||||
tagName: string;
|
||||
/**
|
||||
* Info associated with the element.
|
||||
*/
|
||||
properties: Properties;
|
||||
/**
|
||||
* Children of element.
|
||||
*/
|
||||
children: ElementContent[];
|
||||
/**
|
||||
* When the `tagName` field is `'template'`, a `content` field can be
|
||||
* present.
|
||||
*/
|
||||
content?: Root | undefined;
|
||||
/**
|
||||
* Data associated with the element.
|
||||
*/
|
||||
data?: ElementData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with hast elements by the ecosystem.
|
||||
*/
|
||||
export interface ElementData extends Data {}
|
||||
|
||||
/**
|
||||
* Document fragment or a whole document.
|
||||
*
|
||||
* Should be used as the root of a tree and must not be used as a child.
|
||||
*
|
||||
* Can also be used as the value for the content field on a `'template'` element.
|
||||
*/
|
||||
export interface Root extends Parent {
|
||||
/**
|
||||
* Node type of hast root.
|
||||
*/
|
||||
type: "root";
|
||||
/**
|
||||
* Children of root.
|
||||
*/
|
||||
children: RootContent[];
|
||||
/**
|
||||
* Data associated with the hast root.
|
||||
*/
|
||||
data?: RootData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with hast root nodes by the ecosystem.
|
||||
*/
|
||||
export interface RootData extends Data {}
|
||||
|
||||
/**
|
||||
* HTML character data (plain text).
|
||||
*/
|
||||
export interface Text extends Literal {
|
||||
/**
|
||||
* Node type of HTML character data (plain text) in hast.
|
||||
*/
|
||||
type: "text";
|
||||
/**
|
||||
* Data associated with the text.
|
||||
*/
|
||||
data?: TextData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with hast texts by the ecosystem.
|
||||
*/
|
||||
export interface TextData extends Data {}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "@types/hast",
|
||||
"version": "3.0.5",
|
||||
"description": "TypeScript definitions for hast",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hast",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "lukeggchapman",
|
||||
"githubUsername": "lukeggchapman",
|
||||
"url": "https://github.com/lukeggchapman"
|
||||
},
|
||||
{
|
||||
"name": "Junyoung Choi",
|
||||
"githubUsername": "rokt33r",
|
||||
"url": "https://github.com/rokt33r"
|
||||
},
|
||||
{
|
||||
"name": "Christian Murphy",
|
||||
"githubUsername": "ChristianMurphy",
|
||||
"url": "https://github.com/ChristianMurphy"
|
||||
},
|
||||
{
|
||||
"name": "Remco Haszing",
|
||||
"githubUsername": "remcohaszing",
|
||||
"url": "https://github.com/remcohaszing"
|
||||
},
|
||||
{
|
||||
"name": "Titus Wormer",
|
||||
"githubUsername": "wooorm",
|
||||
"url": "https://github.com/wooorm"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/hast"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/unist": "*"
|
||||
},
|
||||
"peerDependencies": {},
|
||||
"typesPublisherContentHash": "7c853a7c57790776fc3d5f6a721e61b09901a7222feadc4c561ddf607e7b29fc",
|
||||
"typeScriptVersion": "5.6"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/mdast`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for mdast (https://github.com/syntax-tree/mdast).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 14 May 2024 07:35:36 GMT
|
||||
* Dependencies: [@types/unist](https://npmjs.com/package/@types/unist)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Christian Murphy](https://github.com/ChristianMurphy), [Jun Lu](https://github.com/lujun2), [Remco Haszing](https://github.com/remcohaszing), [Titus Wormer](https://github.com/wooorm), and [Remco Haszing](https://github.com/remcohaszing).
|
||||
+1123
File diff suppressed because it is too large.
Load diff
+47
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "@types/mdast",
|
||||
"version": "4.0.4",
|
||||
"description": "TypeScript definitions for mdast",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Christian Murphy",
|
||||
"githubUsername": "ChristianMurphy",
|
||||
"url": "https://github.com/ChristianMurphy"
|
||||
},
|
||||
{
|
||||
"name": "Jun Lu",
|
||||
"githubUsername": "lujun2",
|
||||
"url": "https://github.com/lujun2"
|
||||
},
|
||||
{
|
||||
"name": "Remco Haszing",
|
||||
"githubUsername": "remcohaszing",
|
||||
"url": "https://github.com/remcohaszing"
|
||||
},
|
||||
{
|
||||
"name": "Titus Wormer",
|
||||
"githubUsername": "wooorm",
|
||||
"url": "https://github.com/wooorm"
|
||||
},
|
||||
{
|
||||
"name": "Remco Haszing",
|
||||
"githubUsername": "remcohaszing",
|
||||
"url": "https://github.com/remcohaszing"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/mdast"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/unist": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "1599d3ca45533e9d9248231c90843306b49c07fe13ad94ebf7345da44d8fd4bd",
|
||||
"typeScriptVersion": "4.7"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
# Installation
|
||||
> `npm install --save @types/ms`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for ms (https://github.com/vercel/ms).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ms.
|
||||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ms/index.d.ts)
|
||||
````ts
|
||||
/**
|
||||
* Short/Long format for `value`.
|
||||
*
|
||||
* @param {Number} value
|
||||
* @param {{long: boolean}} options
|
||||
* @return {String}
|
||||
*/
|
||||
declare function ms(value: number, options?: { long: boolean }): string;
|
||||
|
||||
/**
|
||||
* Parse the given `value` and return milliseconds.
|
||||
*
|
||||
* @param {ms.StringValue} value
|
||||
* @return {Number}
|
||||
*/
|
||||
declare function ms(value: ms.StringValue): number;
|
||||
|
||||
declare namespace ms {
|
||||
// Unit, UnitAnyCase, and StringValue are backported from ms@3
|
||||
// https://github.com/vercel/ms/blob/8b5923d1d86c84a9f6aba8022d416dcf2361aa8d/src/index.ts
|
||||
|
||||
type Unit =
|
||||
| "Years"
|
||||
| "Year"
|
||||
| "Yrs"
|
||||
| "Yr"
|
||||
| "Y"
|
||||
| "Weeks"
|
||||
| "Week"
|
||||
| "W"
|
||||
| "Days"
|
||||
| "Day"
|
||||
| "D"
|
||||
| "Hours"
|
||||
| "Hour"
|
||||
| "Hrs"
|
||||
| "Hr"
|
||||
| "H"
|
||||
| "Minutes"
|
||||
| "Minute"
|
||||
| "Mins"
|
||||
| "Min"
|
||||
| "M"
|
||||
| "Seconds"
|
||||
| "Second"
|
||||
| "Secs"
|
||||
| "Sec"
|
||||
| "s"
|
||||
| "Milliseconds"
|
||||
| "Millisecond"
|
||||
| "Msecs"
|
||||
| "Msec"
|
||||
| "Ms";
|
||||
|
||||
type UnitAnyCase = Unit | Uppercase<Unit> | Lowercase<Unit>;
|
||||
|
||||
type StringValue =
|
||||
| `${number}`
|
||||
| `${number}${UnitAnyCase}`
|
||||
| `${number} ${UnitAnyCase}`;
|
||||
}
|
||||
|
||||
export = ms;
|
||||
|
||||
````
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Thu, 16 Jan 2025 21:02:45 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Zhiyuan Wang](https://github.com/danny8002).
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* Short/Long format for `value`.
|
||||
*
|
||||
* @param {Number} value
|
||||
* @param {{long: boolean}} options
|
||||
* @return {String}
|
||||
*/
|
||||
declare function ms(value: number, options?: { long: boolean }): string;
|
||||
|
||||
/**
|
||||
* Parse the given `value` and return milliseconds.
|
||||
*
|
||||
* @param {ms.StringValue} value
|
||||
* @return {Number}
|
||||
*/
|
||||
declare function ms(value: ms.StringValue): number;
|
||||
|
||||
declare namespace ms {
|
||||
// Unit, UnitAnyCase, and StringValue are backported from ms@3
|
||||
// https://github.com/vercel/ms/blob/8b5923d1d86c84a9f6aba8022d416dcf2361aa8d/src/index.ts
|
||||
|
||||
type Unit =
|
||||
| "Years"
|
||||
| "Year"
|
||||
| "Yrs"
|
||||
| "Yr"
|
||||
| "Y"
|
||||
| "Weeks"
|
||||
| "Week"
|
||||
| "W"
|
||||
| "Days"
|
||||
| "Day"
|
||||
| "D"
|
||||
| "Hours"
|
||||
| "Hour"
|
||||
| "Hrs"
|
||||
| "Hr"
|
||||
| "H"
|
||||
| "Minutes"
|
||||
| "Minute"
|
||||
| "Mins"
|
||||
| "Min"
|
||||
| "M"
|
||||
| "Seconds"
|
||||
| "Second"
|
||||
| "Secs"
|
||||
| "Sec"
|
||||
| "s"
|
||||
| "Milliseconds"
|
||||
| "Millisecond"
|
||||
| "Msecs"
|
||||
| "Msec"
|
||||
| "Ms";
|
||||
|
||||
type UnitAnyCase = Unit | Uppercase<Unit> | Lowercase<Unit>;
|
||||
|
||||
type StringValue =
|
||||
| `${number}`
|
||||
| `${number}${UnitAnyCase}`
|
||||
| `${number} ${UnitAnyCase}`;
|
||||
}
|
||||
|
||||
export = ms;
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@types/ms",
|
||||
"version": "2.1.0",
|
||||
"description": "TypeScript definitions for ms",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ms",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Zhiyuan Wang",
|
||||
"githubUsername": "danny8002",
|
||||
"url": "https://github.com/danny8002"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/ms"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"peerDependencies": {},
|
||||
"typesPublisherContentHash": "2c8651ce1714fdc6bcbc0f262c93a790f1d127fb1c2dc8edbb583decef56fd39",
|
||||
"typeScriptVersion": "5.0"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/nlcst`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for nlcst (https://github.com/syntax-tree/nlcst).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nlcst.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT
|
||||
* Dependencies: [@types/unist](https://npmjs.com/package/@types/unist)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Titus Wormer](https://github.com/wooorm), [Christian Murphy](https://github.com/ChristianMurphy), and [Remco Haszing](https://github.com/remcohaszing).
|
||||
+411
@@ -0,0 +1,411 @@
|
||||
import type { Data as UnistData, Literal as UnistLiteral, Node as UnistNode, Parent as UnistParent } from "unist";
|
||||
|
||||
// ## Interfaces
|
||||
|
||||
/**
|
||||
* Info associated with nlcst nodes by the ecosystem.
|
||||
*
|
||||
* This space is guaranteed to never be specified by unist or nlcst.
|
||||
* But you can use it in utilities and plugins to store data.
|
||||
*
|
||||
* This type can be augmented to register custom data.
|
||||
* For example:
|
||||
*
|
||||
* ```ts
|
||||
* declare module 'nlcst' {
|
||||
* interface Data {
|
||||
* // `someNode.data.myId` is typed as `number | undefined`
|
||||
* myId?: number | undefined
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export interface Data extends UnistData {}
|
||||
|
||||
// ## Content maps
|
||||
|
||||
/**
|
||||
* Union of registered nlcst nodes that can occur in {@link Paragraph}.
|
||||
*
|
||||
* To register more custom nlcst nodes, add them to {@link ParagraphContentMap}.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type ParagraphContent = ParagraphContentMap[keyof ParagraphContentMap];
|
||||
|
||||
/**
|
||||
* Registry of all nlcst nodes that can occur as children of {@link Paragraph}.
|
||||
*
|
||||
* For a union of all {@link Paragraph} children, see {@link ParagraphContent}.
|
||||
*/
|
||||
export interface ParagraphContentMap {
|
||||
sentence: Sentence;
|
||||
source: Source;
|
||||
whiteSpace: WhiteSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Union of registered nlcst nodes that can occur in {@link Root}.
|
||||
*
|
||||
* To register custom nlcst nodes, add them to {@link RootContentMap}.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type RootContent = RootContentMap[keyof RootContentMap];
|
||||
|
||||
/**
|
||||
* Registry of all nlcst nodes that can occur as children of {@link Root}.
|
||||
*
|
||||
* > 👉 **Note**: {@link Root} does not need to be an entire document.
|
||||
* > it can also be a fragment.
|
||||
*
|
||||
* For a union of all {@link Root} children, see {@link RootContent}.
|
||||
*/
|
||||
export interface RootContentMap {
|
||||
paragraph: Paragraph;
|
||||
punctuation: Punctuation;
|
||||
sentence: Sentence;
|
||||
source: Source;
|
||||
symbol: Symbol;
|
||||
text: Text;
|
||||
whiteSpace: WhiteSpace;
|
||||
word: Word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Union of registered nlcst nodes that can occur in {@link Sentence}.
|
||||
*
|
||||
* To register more custom nlcst nodes, add them to {@link SentenceContentMap}.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type SentenceContent = SentenceContentMap[keyof SentenceContentMap];
|
||||
|
||||
/**
|
||||
* Registry of all nlcst nodes that can occur as children of {@link Sentence}.
|
||||
*
|
||||
* For a union of all {@link Sentence} children, see {@link SentenceContent}.
|
||||
*/
|
||||
export interface SentenceContentMap {
|
||||
punctuation: Punctuation;
|
||||
source: Source;
|
||||
symbol: Symbol;
|
||||
whiteSpace: WhiteSpace;
|
||||
word: Word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Union of registered nlcst nodes that can occur in {@link Word}.
|
||||
*
|
||||
* To register more custom nlcst nodes, add them to {@link WordContentMap}.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type WordContent = WordContentMap[keyof WordContentMap];
|
||||
|
||||
/**
|
||||
* Registry of all nlcst nodes that can occur as children of {@link Word}.
|
||||
*
|
||||
* For a union of all {@link Word} children, see {@link WordContent}.
|
||||
*/
|
||||
export interface WordContentMap {
|
||||
punctuation: Punctuation;
|
||||
source: Source;
|
||||
symbol: Symbol;
|
||||
text: Text;
|
||||
}
|
||||
|
||||
// ### Special content types
|
||||
|
||||
/**
|
||||
* Union of registered nlcst nodes that can occur in {@link Root}.
|
||||
*
|
||||
* @deprecated Use {@link RootContent} instead.
|
||||
*/
|
||||
export type Content = RootContent;
|
||||
|
||||
/**
|
||||
* Union of registered nlcst literals.
|
||||
*
|
||||
* To register custom nlcst nodes, add them to {@link RootContentMap} and other
|
||||
* places where relevant.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type Literals = Extract<Nodes, UnistLiteral>;
|
||||
|
||||
/**
|
||||
* Union of registered nlcst nodes.
|
||||
*
|
||||
* To register custom nlcst nodes, add them to {@link RootContentMap} and other
|
||||
* places where relevant.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type Nodes = Root | RootContent;
|
||||
|
||||
/**
|
||||
* Union of registered nlcst parents.
|
||||
*
|
||||
* To register custom nlcst nodes, add them to {@link RootContentMap} and other
|
||||
* places where relevant.
|
||||
* They will be automatically added here.
|
||||
*/
|
||||
export type Parents = Extract<Nodes, UnistParent>;
|
||||
|
||||
// ## Abstract nodes
|
||||
|
||||
/**
|
||||
* Abstract nlcst node that contains the smallest possible value.
|
||||
*
|
||||
* This interface is supposed to be extended if you make custom nlcst nodes.
|
||||
*
|
||||
* For a union of all registered nlcst literals, see {@link Literals}.
|
||||
*/
|
||||
export interface Literal extends Node {
|
||||
/**
|
||||
* Plain-text value.
|
||||
*/
|
||||
value: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract nlcst node.
|
||||
*
|
||||
* This interface is supposed to be extended.
|
||||
* If you can use {@link Literal} or {@link Parent}, you should.
|
||||
* But for example in markdown, a `thematicBreak` (`***`) is neither literal
|
||||
* nor parent, but still a node.
|
||||
*
|
||||
* To register custom nlcst nodes, add them to {@link RootContentMap} and other
|
||||
* places where relevant (such as {@link SentenceContentMap}).
|
||||
*
|
||||
* For a union of all registered nlcst nodes, see {@link Nodes}.
|
||||
*/
|
||||
export interface Node extends UnistNode {
|
||||
/**
|
||||
* Info from the ecosystem.
|
||||
*/
|
||||
data?: Data | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract nlcst node that contains other nlcst nodes (*children*).
|
||||
*
|
||||
* This interface is supposed to be extended if you make custom nlcst nodes.
|
||||
*
|
||||
* For a union of all registered nlcst parents, see {@link Parents}.
|
||||
*/
|
||||
export interface Parent extends Node {
|
||||
/**
|
||||
* List of children.
|
||||
*/
|
||||
children: RootContent[];
|
||||
}
|
||||
|
||||
// ## Concrete nodes
|
||||
|
||||
/**
|
||||
* Unit of discourse dealing with a particular point or idea.
|
||||
*
|
||||
* Can contain sentence, whitespace, and source nodes.
|
||||
*/
|
||||
export interface Paragraph extends Parent {
|
||||
/**
|
||||
* Node type of nlcst paragraph.
|
||||
*/
|
||||
type: "ParagraphNode";
|
||||
/**
|
||||
* Children of paragraph.
|
||||
*/
|
||||
children: ParagraphContent[];
|
||||
/**
|
||||
* Data associated with the nlcst paragraph.
|
||||
*/
|
||||
data?: ParagraphData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with nlcst paragraph nodes by the ecosystem.
|
||||
*/
|
||||
export interface ParagraphData extends Data {}
|
||||
|
||||
/**
|
||||
* Typographical devices which aid understanding and correct reading of other
|
||||
* grammatical units.
|
||||
*
|
||||
* Can be used in sentence or word nodes.
|
||||
*/
|
||||
export interface Punctuation extends Literal {
|
||||
/**
|
||||
* Node type of nlcst punctuations.
|
||||
*/
|
||||
type: "PunctuationNode";
|
||||
/**
|
||||
* Data associated with the nlcst punctuation.
|
||||
*/
|
||||
data?: PunctuationData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with nlcst punctuation nodes by the ecosystem.
|
||||
*/
|
||||
export interface PunctuationData extends Data {}
|
||||
|
||||
/**
|
||||
* Document fragment or a whole document.
|
||||
*
|
||||
* Should be used as the root of a tree and must not be used as a child.
|
||||
* Its content model is not limited, it can contain any nlcst content, with the
|
||||
* restriction that all content must be of the same category.
|
||||
*/
|
||||
export interface Root extends Parent {
|
||||
/**
|
||||
* Node type of nlcst root.
|
||||
*/
|
||||
type: "RootNode";
|
||||
/**
|
||||
* Data associated with the nlcst root.
|
||||
*/
|
||||
data?: RootData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with nlcst root nodes by the ecosystem.
|
||||
*/
|
||||
export interface RootData extends Data {}
|
||||
|
||||
/**
|
||||
* Grouping of grammatically linked words, that in principle tells a complete
|
||||
* thought, although it may make little sense taken in isolation out of
|
||||
* context.
|
||||
*
|
||||
* Can be used in a paragraph node.
|
||||
* Can contain word, symbol, punctuation, whitespace, and source nodes.
|
||||
*/
|
||||
export interface Sentence extends Parent {
|
||||
/**
|
||||
* Node type of nlcst sentence.
|
||||
*/
|
||||
type: "SentenceNode";
|
||||
/**
|
||||
* Children of sentence.
|
||||
*/
|
||||
children: SentenceContent[];
|
||||
/**
|
||||
* Data associated with the nlcst sentence.
|
||||
*/
|
||||
data?: SentenceData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with nlcst sentence nodes by the ecosystem.
|
||||
*/
|
||||
export interface SentenceData extends Data {}
|
||||
|
||||
/**
|
||||
* External (ungrammatical) value embedded into a grammatical unit: a hyperlink,
|
||||
* code, and such.
|
||||
*
|
||||
* Can be used in root, paragraph, sentence, or word nodes.
|
||||
*/
|
||||
export interface Source extends Literal {
|
||||
/**
|
||||
* Node type of nlcst sources.
|
||||
*/
|
||||
type: "SourceNode";
|
||||
/**
|
||||
* Data associated with the nlcst source.
|
||||
*/
|
||||
data?: SourceData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with nlcst source nodes by the ecosystem.
|
||||
*/
|
||||
export interface SourceData extends Data {}
|
||||
|
||||
/**
|
||||
* Typographical devices different from characters which represent sounds (like
|
||||
* letters and numerals), white space, or punctuation.
|
||||
*
|
||||
* Can be used in sentence or word nodes.
|
||||
*/
|
||||
export interface Symbol extends Literal {
|
||||
/**
|
||||
* Node type of nlcst symbols.
|
||||
*/
|
||||
type: "SymbolNode";
|
||||
/**
|
||||
* Data associated with the nlcst symbol.
|
||||
*/
|
||||
data?: SymbolData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with nlcst symbol nodes by the ecosystem.
|
||||
*/
|
||||
export interface SymbolData extends Data {}
|
||||
|
||||
/**
|
||||
* Actual content in nlcst documents: one or more characters.
|
||||
*
|
||||
* Can be used in word nodes.
|
||||
*/
|
||||
export interface Text extends Literal {
|
||||
/**
|
||||
* Node type of nlcst texts.
|
||||
*/
|
||||
type: "TextNode";
|
||||
/**
|
||||
* Data associated with the nlcst text.
|
||||
*/
|
||||
data?: TextData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with nlcst text nodes by the ecosystem.
|
||||
*/
|
||||
export interface TextData extends Data {}
|
||||
|
||||
/**
|
||||
* Typographical devices devoid of content, separating other units.
|
||||
*
|
||||
* Can be used in root, paragraph, or sentence nodes.
|
||||
*/
|
||||
export interface WhiteSpace extends Literal {
|
||||
/**
|
||||
* Node type of nlcst white space.
|
||||
*/
|
||||
type: "WhiteSpaceNode";
|
||||
/**
|
||||
* Data associated with the nlcst white space.
|
||||
*/
|
||||
data?: WhiteSpaceData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with nlcst white space nodes by the ecosystem.
|
||||
*/
|
||||
export interface WhiteSpaceData extends Data {}
|
||||
|
||||
/**
|
||||
* Smallest element that may be uttered in isolation with semantic or pragmatic
|
||||
* content.
|
||||
*
|
||||
* Can be used in a sentence node.
|
||||
* Can contain text, symbol, punctuation, and source nodes.
|
||||
*/
|
||||
export interface Word extends Parent {
|
||||
/**
|
||||
* Node type of nlcst word.
|
||||
*/
|
||||
type: "WordNode";
|
||||
/**
|
||||
* Children of word.
|
||||
*/
|
||||
children: WordContent[];
|
||||
/**
|
||||
* Data associated with the nlcst word.
|
||||
*/
|
||||
data?: WordData | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info associated with nlcst word nodes by the ecosystem.
|
||||
*/
|
||||
export interface WordData extends Data {}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "@types/nlcst",
|
||||
"version": "2.0.3",
|
||||
"description": "TypeScript definitions for nlcst",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nlcst",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Titus Wormer",
|
||||
"githubUsername": "wooorm",
|
||||
"url": "https://github.com/wooorm"
|
||||
},
|
||||
{
|
||||
"name": "Christian Murphy",
|
||||
"githubUsername": "ChristianMurphy",
|
||||
"url": "https://github.com/ChristianMurphy"
|
||||
},
|
||||
{
|
||||
"name": "Remco Haszing",
|
||||
"githubUsername": "remcohaszing",
|
||||
"url": "https://github.com/remcohaszing"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/nlcst"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/unist": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "0fa949bca84428c174a30ddfe401eb6dbef19a2e0731309d9e4861bfe8f63540",
|
||||
"typeScriptVersion": "4.5",
|
||||
"nonNpm": true
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/unist`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for unist (https://github.com/syntax-tree/unist).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Thu, 15 Aug 2024 02:18:53 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing).
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
// ## Interfaces
|
||||
|
||||
/**
|
||||
* Info associated with nodes by the ecosystem.
|
||||
*
|
||||
* This space is guaranteed to never be specified by unist or specifications
|
||||
* implementing unist.
|
||||
* But you can use it in utilities and plugins to store data.
|
||||
*
|
||||
* This type can be augmented to register custom data.
|
||||
* For example:
|
||||
*
|
||||
* ```ts
|
||||
* declare module 'unist' {
|
||||
* interface Data {
|
||||
* // `someNode.data.myId` is typed as `number | undefined`
|
||||
* myId?: number | undefined
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export interface Data {}
|
||||
|
||||
/**
|
||||
* One place in a source file.
|
||||
*/
|
||||
export interface Point {
|
||||
/**
|
||||
* Line in a source file (1-indexed integer).
|
||||
*/
|
||||
line: number;
|
||||
|
||||
/**
|
||||
* Column in a source file (1-indexed integer).
|
||||
*/
|
||||
column: number;
|
||||
/**
|
||||
* Character in a source file (0-indexed integer).
|
||||
*/
|
||||
offset?: number | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Position of a node in a source document.
|
||||
*
|
||||
* A position is a range between two points.
|
||||
*/
|
||||
export interface Position {
|
||||
/**
|
||||
* Place of the first character of the parsed source region.
|
||||
*/
|
||||
start: Point;
|
||||
|
||||
/**
|
||||
* Place of the first character after the parsed source region.
|
||||
*/
|
||||
end: Point;
|
||||
}
|
||||
|
||||
// ## Abstract nodes
|
||||
|
||||
/**
|
||||
* Abstract unist node that contains the smallest possible value.
|
||||
*
|
||||
* This interface is supposed to be extended.
|
||||
*
|
||||
* For example, in HTML, a `text` node is a leaf that contains text.
|
||||
*/
|
||||
export interface Literal extends Node {
|
||||
/**
|
||||
* Plain value.
|
||||
*/
|
||||
value: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract unist node.
|
||||
*
|
||||
* The syntactic unit in unist syntax trees are called nodes.
|
||||
*
|
||||
* This interface is supposed to be extended.
|
||||
* If you can use {@link Literal} or {@link Parent}, you should.
|
||||
* But for example in markdown, a `thematicBreak` (`***`), is neither literal
|
||||
* nor parent, but still a node.
|
||||
*/
|
||||
export interface Node {
|
||||
/**
|
||||
* Node type.
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* Info from the ecosystem.
|
||||
*/
|
||||
data?: Data | undefined;
|
||||
|
||||
/**
|
||||
* Position of a node in a source document.
|
||||
*
|
||||
* Nodes that are generated (not in the original source document) must not
|
||||
* have a position.
|
||||
*/
|
||||
position?: Position | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract unist node that contains other nodes (*children*).
|
||||
*
|
||||
* This interface is supposed to be extended.
|
||||
*
|
||||
* For example, in XML, an element is a parent of different things, such as
|
||||
* comments, text, and further elements.
|
||||
*/
|
||||
export interface Parent extends Node {
|
||||
/**
|
||||
* List of children.
|
||||
*/
|
||||
children: Node[];
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "@types/unist",
|
||||
"version": "3.0.3",
|
||||
"description": "TypeScript definitions for unist",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "bizen241",
|
||||
"githubUsername": "bizen241",
|
||||
"url": "https://github.com/bizen241"
|
||||
},
|
||||
{
|
||||
"name": "Jun Lu",
|
||||
"githubUsername": "lujun2",
|
||||
"url": "https://github.com/lujun2"
|
||||
},
|
||||
{
|
||||
"name": "Hernan Rajchert",
|
||||
"githubUsername": "hrajchert",
|
||||
"url": "https://github.com/hrajchert"
|
||||
},
|
||||
{
|
||||
"name": "Titus Wormer",
|
||||
"githubUsername": "wooorm",
|
||||
"url": "https://github.com/wooorm"
|
||||
},
|
||||
{
|
||||
"name": "Junyoung Choi",
|
||||
"githubUsername": "rokt33r",
|
||||
"url": "https://github.com/rokt33r"
|
||||
},
|
||||
{
|
||||
"name": "Ben Moon",
|
||||
"githubUsername": "GuiltyDolphin",
|
||||
"url": "https://github.com/GuiltyDolphin"
|
||||
},
|
||||
{
|
||||
"name": "JounQin",
|
||||
"githubUsername": "JounQin",
|
||||
"url": "https://github.com/JounQin"
|
||||
},
|
||||
{
|
||||
"name": "Remco Haszing",
|
||||
"githubUsername": "remcohaszing",
|
||||
"url": "https://github.com/remcohaszing"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/unist"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe",
|
||||
"typeScriptVersion": "4.8"
|
||||
}
|
||||
Reference in new issue
Block a user