forked from corenova/yang-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
50 lines (42 loc) · 1.24 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Type definitions for yang-js
// Project: yang-js
// Definitions by: quan.tang
import EventEmitter = NodeJS.EventEmitter;
export function parse(schema: string): YangInstance;
export function compose(data: any): YangInstance;
export function resolve(name: any): YangInstance;
export function clear(): void;
export interface YangInstance {
bind(obj: any): this;
eval(data?: any): YangModel;
validate(data: any): any;
extends(schema: string): this;
}
export interface YangModel extends YangProperty {
access(model: string): YangModel;
on(event: string, path: string, callback: any): EventEmitter;
}
export interface YangProperty {
name: string;
parent: YangProperty;
path: YangXPath;
children: YangProperty[];
schema: any;
change: any[];
get(key?: string): any;
set(value: any): this;
merge(value: any): this;
create(value: any): this;
detach(): this;
find(pattern?: string): YangProperty;
in(pattern?: string): YangProperty;
do(): Promise<any>;
toJSON(tag?: boolean): any;
}
export interface YangXPath {
tail: YangXPath;
contains(path: string): boolean;
locate(path: string): YangXPath;
}
export function _import(name: string): YangInstance;
export {_import as import};