1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | declare namespace jsyaml {
|
7 | export function safeLoad(str: string, opts?: LoadOptions): any;
|
8 | export function load(str: string, opts?: LoadOptions): any;
|
9 |
|
10 | export class Type implements TypeConstructorOptions {
|
11 | constructor(tag: string, opts?: TypeConstructorOptions);
|
12 | tag: string;
|
13 | }
|
14 | export class Schema {
|
15 | constructor(definition: SchemaDefinition);
|
16 | public static create(args: any[]): Schema;
|
17 | }
|
18 |
|
19 | export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any;
|
20 | export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any;
|
21 |
|
22 | export function safeDump(obj: any, opts?: DumpOptions): string;
|
23 | export function dump(obj: any, opts?: DumpOptions): string;
|
24 |
|
25 | export interface LoadOptions {
|
26 |
|
27 | filename?: string;
|
28 |
|
29 | strict?: boolean;
|
30 |
|
31 | schema?: any;
|
32 | }
|
33 |
|
34 | export interface DumpOptions {
|
35 |
|
36 | indent?: number;
|
37 |
|
38 | skipInvalid?: boolean;
|
39 |
|
40 | flowLevel?: number;
|
41 |
|
42 | styles?: Object;
|
43 |
|
44 | schema?: any;
|
45 |
|
46 | sortKeys?: boolean | ((a: any, b: any) => number);
|
47 | // set max line width. (default: 80)
|
48 | lineWidth?: number;
|
49 | // if true, don't convert duplicate objects into references (default: false)
|
50 | noRefs?: boolean;
|
51 | // if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false)
|
52 | noCompatMode?: boolean;
|
53 | }
|
54 |
|
55 | export interface TypeConstructorOptions {
|
56 | kind?: string;
|
57 | resolve?: Function;
|
58 | construct?: Function;
|
59 | instanceOf?: Object;
|
60 | predicate?: string;
|
61 | represent?: Function;
|
62 | defaultStyle?: string;
|
63 | styleAliases?: Object;
|
64 | }
|
65 |
|
66 | export interface SchemaDefinition {
|
67 | implicit?: any[];
|
68 | explicit?: any[];
|
69 | include?: any[];
|
70 | }
|
71 |
|
72 | // only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
|
73 | export var FAILSAFE_SCHEMA: any;
|
74 | // only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
|
75 | export var JSON_SCHEMA: any;
|
76 | // same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923
|
77 | export var CORE_SCHEMA: any;
|
78 | // all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/
|
79 | export var DEFAULT_SAFE_SCHEMA: any;
|
80 | // all supported YAML types.
|
81 | export var DEFAULT_FULL_SCHEMA: any;
|
82 | export var MINIMAL_SCHEMA: any;
|
83 | export var SAFE_SCHEMA: any;
|
84 |
|
85 | export class YAMLException extends Error {
|
86 | constructor(reason?: any, mark?: any);
|
87 | toString(compact?: boolean): string;
|
88 | }
|
89 | }
|
90 |
|
91 | export = jsyaml;
|
92 | export as namespace jsyaml;
|
93 |
|
\ | No newline at end of file |