diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:05:55 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:05:55 +0800 |
| commit | c06f7ee0a40255214c477e13d9b956a7e07c2900 (patch) | |
| tree | f5982a568ef8fab865d0142e71c7494fea3e4c1b /node_modules/yaml/dist/nodes/Node.d.ts | |
| parent | 3fd9400d4dccc25aa29b5702216732e0b7542073 (diff) | |
postcss,(plugins): nanocss, postcss-preset-env
Diffstat (limited to 'node_modules/yaml/dist/nodes/Node.d.ts')
| -rw-r--r-- | node_modules/yaml/dist/nodes/Node.d.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/node_modules/yaml/dist/nodes/Node.d.ts b/node_modules/yaml/dist/nodes/Node.d.ts new file mode 100644 index 00000000..fe91ba6b --- /dev/null +++ b/node_modules/yaml/dist/nodes/Node.d.ts @@ -0,0 +1,46 @@ +import type { Document } from '../doc/Document.js'; +import type { ToJSOptions } from '../options.js'; +import { Token } from '../parse/cst.js'; +import type { StringifyContext } from '../stringify/stringify.js'; +import type { Alias } from './Alias.js'; +import { NODE_TYPE } from './identity.js'; +import type { Scalar } from './Scalar.js'; +import type { YAMLMap } from './YAMLMap.js'; +import type { YAMLSeq } from './YAMLSeq.js'; +export type Node<T = unknown> = Alias | Scalar<T> | YAMLMap<unknown, T> | YAMLSeq<T>; +/** Utility type mapper */ +export type NodeType<T> = T extends string | number | bigint | boolean | null | undefined ? Scalar<T> : T extends Date ? Scalar<string | Date> : T extends Array<any> ? YAMLSeq<NodeType<T[number]>> : T extends { + [key: string]: any; +} ? YAMLMap<NodeType<keyof T>, NodeType<T[keyof T]>> : T extends { + [key: number]: any; +} ? YAMLMap<NodeType<keyof T>, NodeType<T[keyof T]>> : Node; +export type ParsedNode = Alias.Parsed | Scalar.Parsed | YAMLMap.Parsed | YAMLSeq.Parsed; +export type Range = [number, number, number]; +export declare abstract class NodeBase { + readonly [NODE_TYPE]: symbol; + /** A comment on or immediately after this */ + comment?: string | null; + /** A comment before this */ + commentBefore?: string | null; + /** + * The `[start, value-end, node-end]` character offsets for the part of the + * source parsed into this node (undefined if not parsed). The `value-end` + * and `node-end` positions are themselves not included in their respective + * ranges. + */ + range?: Range | null; + /** A blank line before this node and its commentBefore */ + spaceBefore?: boolean; + /** The CST token that was composed into this node. */ + srcToken?: Token; + /** A fully qualified tag, if required */ + tag?: string; + /** A plain JS representation of this node */ + abstract toJSON(): any; + abstract toString(ctx?: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string; + constructor(type: symbol); + /** Create a copy of this node. */ + clone(): NodeBase; + /** A plain JavaScript representation of this node. */ + toJS(doc: Document<Node, boolean>, { mapAsMap, maxAliasCount, onAnchor, reviver }?: ToJSOptions): any; +} |
