@komaci/types 240.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,151 @@
1
+ export declare type PrimitiveValue = {
2
+ type: 'PrimitiveValue';
3
+ value: number | string | boolean | null | undefined;
4
+ };
5
+ export interface IArrayValue<T> {
6
+ type: 'ArrayValue';
7
+ value: T[];
8
+ }
9
+ export interface IObjectValue<T> {
10
+ type: 'ObjectValue';
11
+ value: {
12
+ [k: string]: T;
13
+ };
14
+ }
15
+ /**
16
+ * Type for an Internal Reference
17
+ */
18
+ export declare type InternalReference = {
19
+ type: 'InternalReference';
20
+ value: string;
21
+ };
22
+ export declare type UnresolvedValue = {
23
+ type: 'Unresolved';
24
+ value: string;
25
+ location?: SourceLocation;
26
+ };
27
+ export declare type ImportReference = {
28
+ type: 'ImportReference';
29
+ value: string;
30
+ namespacedMember?: string;
31
+ location?: SourceLocation;
32
+ };
33
+ export declare type FunctionReference = {
34
+ type: 'FunctionReference';
35
+ value: number;
36
+ };
37
+ export declare type AdgReference = {
38
+ type: 'AdgReference';
39
+ value: number;
40
+ location?: SourceLocation;
41
+ };
42
+ export declare type CompositionReference = {
43
+ type: 'CompositionReference';
44
+ value: number;
45
+ };
46
+ export declare type PropertyReference = {
47
+ type: 'PropertyReference';
48
+ value: string;
49
+ };
50
+ export declare type Binding = {
51
+ type: 'Binding';
52
+ value: string;
53
+ };
54
+ export declare type SourceLocation = {
55
+ startLine: number;
56
+ startColumn: number;
57
+ endLine: number;
58
+ endColumn: number;
59
+ };
60
+ export declare type StaticValue = PrimitiveValue | ImportReference | UnresolvedValue | IArrayValue<StaticValue> | IObjectValue<StaticValue>;
61
+ export declare type Value = StaticValue | PropertyReference | IArrayValue<Value> | IObjectValue<Value> | Binding;
62
+ export declare type Property = {
63
+ isPublic?: boolean;
64
+ initial?: StaticValue;
65
+ input?: StaticValue | FunctionReference;
66
+ };
67
+ export declare type FunctionType = {
68
+ reference: ImportReference | InternalReference | UnresolvedValue;
69
+ input?: Value[];
70
+ type: string;
71
+ location?: SourceLocation;
72
+ };
73
+ export declare type WireFunction = FunctionType & {
74
+ type: 'WireFunction';
75
+ adapterLocation?: SourceLocation;
76
+ adapterConfigLocations?: {
77
+ [prop: string]: SourceLocation;
78
+ };
79
+ };
80
+ /**
81
+ * A special type of function that just holds the info about an error that broke esm
82
+ */
83
+ export declare type ErrorFunction = FunctionType & {
84
+ type: 'ErrorFunction';
85
+ input: Value;
86
+ reference: UnresolvedValue;
87
+ };
88
+ export declare type Adg = {
89
+ parentClass?: ImportReference | AdgReference | UnresolvedValue;
90
+ properties?: {
91
+ [k: string]: Property;
92
+ };
93
+ functions?: FunctionType[];
94
+ compositions?: (CompositionReference | ImportReference)[];
95
+ };
96
+ /** Image type which itself is a type of Composition */
97
+ export declare type Image = Composition & {
98
+ type: 'Image';
99
+ src: PrimitiveValue | Binding;
100
+ };
101
+ export declare type Composition = {
102
+ type: 'Container' | 'Iteration' | 'Slot' | 'ComposedAdg' | 'Image';
103
+ isActive?: Condition;
104
+ compositions?: Composition[];
105
+ location?: SourceLocation;
106
+ };
107
+ declare type Condition = {
108
+ input: Binding;
109
+ negate?: boolean;
110
+ };
111
+ export declare type Container = Composition & {
112
+ type: 'Container';
113
+ slot?: string;
114
+ key?: Binding;
115
+ };
116
+ export declare type Iteration = Composition & {
117
+ type: 'Iteration';
118
+ input: Binding;
119
+ iterator: string;
120
+ };
121
+ export declare type Slot = Composition & {
122
+ type: 'Slot';
123
+ name: string;
124
+ key?: Binding;
125
+ /** Name of target slot composition, empty string for default slot. */
126
+ slot?: string;
127
+ };
128
+ export declare type ComposedAdg = Composition & {
129
+ type: 'ComposedAdg';
130
+ input: Binding | ImportReference;
131
+ properties?: {
132
+ [k: string]: Binding | PrimitiveValue;
133
+ };
134
+ slot?: string;
135
+ key?: Binding;
136
+ };
137
+ export declare type Import = {
138
+ resourceName: string;
139
+ names: string[];
140
+ };
141
+ export declare type Export = AdgReference | CompositionReference;
142
+ export declare type KomaciDocument = {
143
+ adgs?: Adg[];
144
+ compositions?: Composition[];
145
+ imports?: Import[];
146
+ exports?: {
147
+ [k: string]: Export | null;
148
+ };
149
+ };
150
+ export {};
151
+ //# sourceMappingURL=index.d.ts.map
package/build/index.js ADDED
@@ -0,0 +1,7 @@
1
+ //////////////////////////////////////////////////////////////
2
+ //
3
+ // Types defining the canonical Komaci schema.
4
+ //
5
+ /////////////////////////////////////////////////////////////
6
+ export {};
7
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@komaci/types",
3
+ "version": "240.1.3",
4
+ "description": "Komaci types",
5
+ "homepage": "https://komaci.dev/",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/salesforce/komaci.git",
9
+ "directory": "packages/@komaci/types"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/salesforce/komaci/issues"
13
+ },
14
+ "license": "MIT",
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "type": "module",
19
+ "types": "build/index.d.ts",
20
+ "main": "build/index.js",
21
+ "scripts": {
22
+ "build": "tsc -b"
23
+ },
24
+ "files": [
25
+ "build/**/*.js",
26
+ "build/**/*.d.ts"
27
+ ]
28
+ }