forked from Mikerah/AirScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
air-script.d.ts
80 lines (67 loc) · 2.75 KB
/
air-script.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
declare module '@guildofweavers/air-script' {
// IMPORTS AND RE-EXPORTS
// --------------------------------------------------------------------------------------------
import { AirSchema, InputRegisterMaster, Dimensions, ValueSequence } from '@guildofweavers/air-assembly';
export { AirSchema } from '@guildofweavers/air-assembly';
// PUBLIC INTERFACES
// --------------------------------------------------------------------------------------------
export class AirScriptError {
readonly errors: any[];
constructor(errors: any[]);
}
/**
* Parses and compiles AirScript file into an AirSchema object.
* @param path Path to the file containing AirScript source.
* @param componentName Optional component name to be assigned to the parsed module.
*/
export function compile(path: string, componentName?: string): AirSchema;
/**
* Parses and compiles AirScript source code into an AirSchema object.
* @param source Buffer containing AirScript source code.
* @param componentName Optional component name to be assigned to the parsed module.
*/
export function compile(source: Buffer, componentName?: string): AirSchema;
// INTERNAL INTERFACES
// --------------------------------------------------------------------------------------------
export type Interval = [number, number];
export interface InputRegister {
readonly scope : string;
readonly binary : boolean;
readonly master? : InputRegisterMaster;
readonly steps? : number;
readonly loopAnchor?: boolean;
}
export interface MaskRegister {
readonly input : number;
readonly path : number[];
}
export interface SegmentRegister {
readonly mask : bigint[];
readonly path : number[];
}
export interface StaticRegister {
readonly values : bigint[] | ValueSequence;
}
export interface SymbolInfo {
readonly type : 'const' | 'input' | 'static' | 'param' | 'func';
readonly handle : string;
readonly dimensions : Dimensions;
readonly subset : boolean;
readonly offset? : number;
}
export interface FunctionInfo extends SymbolInfo {
readonly type : 'func';
readonly rank : number;
readonly auxOffset : number;
readonly auxCount : number;
readonly maskCount : number;
readonly inputCount : number;
readonly cycleLength: number;
}
export interface InputInfo extends SymbolInfo {
readonly type : 'input';
readonly scope : string;
readonly binary : boolean;
readonly rank : number;
}
}