diff options
author | Minteck <contact@minteck.org> | 2022-01-21 14:39:46 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-01-21 14:39:46 +0100 |
commit | 3a04cb197f152f171fba679663a91a9bb61d710e (patch) | |
tree | 825d8f9b0daab3e434d85704144ca87492da9b92 /node_modules/yaml/util.d.ts | |
parent | c2aa7bf38fb30de2d04f87f8e7780e4c768ae6b1 (diff) | |
download | cobalt-3a04cb197f152f171fba679663a91a9bb61d710e.tar.gz cobalt-3a04cb197f152f171fba679663a91a9bb61d710e.tar.bz2 cobalt-3a04cb197f152f171fba679663a91a9bb61d710e.zip |
Add config management
Diffstat (limited to 'node_modules/yaml/util.d.ts')
-rw-r--r-- | node_modules/yaml/util.d.ts | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/node_modules/yaml/util.d.ts b/node_modules/yaml/util.d.ts new file mode 100644 index 0000000..b135541 --- /dev/null +++ b/node_modules/yaml/util.d.ts @@ -0,0 +1,86 @@ +import { Document } from './index' +import { CST } from './parse-cst' +import { AST, Pair, Scalar, Schema } from './types' + +export function findPair(items: any[], key: Scalar | any): Pair | undefined + +export function parseMap(doc: Document, cst: CST.Map): AST.BlockMap +export function parseMap(doc: Document, cst: CST.FlowMap): AST.FlowMap +export function parseSeq(doc: Document, cst: CST.Seq): AST.BlockSeq +export function parseSeq(doc: Document, cst: CST.FlowSeq): AST.FlowSeq + +export function stringifyNumber(item: Scalar): string +export function stringifyString( + item: Scalar, + ctx: Schema.StringifyContext, + onComment?: () => void, + onChompKeep?: () => void +): string + +export function toJSON( + value: any, + arg?: any, + ctx?: Schema.CreateNodeContext +): any + +export enum Type { + ALIAS = 'ALIAS', + BLANK_LINE = 'BLANK_LINE', + BLOCK_FOLDED = 'BLOCK_FOLDED', + BLOCK_LITERAL = 'BLOCK_LITERAL', + COMMENT = 'COMMENT', + DIRECTIVE = 'DIRECTIVE', + DOCUMENT = 'DOCUMENT', + FLOW_MAP = 'FLOW_MAP', + FLOW_SEQ = 'FLOW_SEQ', + MAP = 'MAP', + MAP_KEY = 'MAP_KEY', + MAP_VALUE = 'MAP_VALUE', + PLAIN = 'PLAIN', + QUOTE_DOUBLE = 'QUOTE_DOUBLE', + QUOTE_SINGLE = 'QUOTE_SINGLE', + SEQ = 'SEQ', + SEQ_ITEM = 'SEQ_ITEM' +} + +interface LinePos { + line: number + col: number +} + +export class YAMLError extends Error { + name: + | 'YAMLReferenceError' + | 'YAMLSemanticError' + | 'YAMLSyntaxError' + | 'YAMLWarning' + message: string + source?: CST.Node + + nodeType?: Type + range?: CST.Range + linePos?: { start: LinePos; end: LinePos } + + /** + * Drops `source` and adds `nodeType`, `range` and `linePos`, as well as + * adding details to `message`. Run automatically for document errors if + * the `prettyErrors` option is set. + */ + makePretty(): void +} + +export class YAMLReferenceError extends YAMLError { + name: 'YAMLReferenceError' +} + +export class YAMLSemanticError extends YAMLError { + name: 'YAMLSemanticError' +} + +export class YAMLSyntaxError extends YAMLError { + name: 'YAMLSyntaxError' +} + +export class YAMLWarning extends YAMLError { + name: 'YAMLWarning' +} |