Merge pull request #18978 from aeisenberg/master

Updates type definitions for js-yaml
This commit is contained in:
Daniel Rosenwasser
2017-08-15 11:31:11 -07:00
committed by GitHub
2 changed files with 10 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
// Type definitions for js-yaml 3.9.0
// Type definitions for js-yaml 3.9.1
// Project: https://github.com/nodeca/js-yaml
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Sebastian Clausen <https://github.com/sclausen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -14,7 +14,8 @@ declare namespace jsyaml {
}
export class Schema {
constructor(definition: SchemaDefinition);
public static create(args: any[]): Schema;
public static create(types: Type[] | Type): Schema;
public static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema;
}
export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any;

View File

@@ -106,4 +106,10 @@ value = yaml.dump(str, dumpOpts);
value = new yaml.YAMLException();
value = new yaml.Type(str, typeConstructorOptions);
value = yaml.Schema.create([schemaDefinition]);
value = new yaml.Schema(schemaDefinition);
value = yaml.Schema.create([new yaml.Type(str)]);
value = yaml.Schema.create(new yaml.Type(str));
value = yaml.Schema.create(new yaml.Schema(schemaDefinition), [new yaml.Type(str)]);
value = yaml.Schema.create([new yaml.Schema(schemaDefinition)], [new yaml.Type(str)]);
value = yaml.Schema.create(new yaml.Schema(schemaDefinition), new yaml.Type(str));
value = yaml.Schema.create([new yaml.Schema(schemaDefinition)], new yaml.Type(str));