@terraforge/core 0.0.7 → 0.0.9
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.
- package/dist/index.d.ts +17 -17
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ declare const interpolate: (literals: TemplateStringsArray, ...placeholders: Inp
|
|
|
42
42
|
type URN = `urn:${string}`;
|
|
43
43
|
|
|
44
44
|
declare const nodeMetaSymbol: unique symbol;
|
|
45
|
-
type Node<T extends Tag = Tag,
|
|
46
|
-
readonly [nodeMetaSymbol]: Meta<T
|
|
45
|
+
type Node<T extends Tag = Tag, O extends State = State> = {
|
|
46
|
+
readonly [nodeMetaSymbol]: Meta<T>;
|
|
47
47
|
readonly urn: URN;
|
|
48
48
|
} & O;
|
|
49
49
|
declare const isNode: (obj: object) => obj is {
|
|
@@ -66,14 +66,14 @@ type ResourceConfig = Config & {
|
|
|
66
66
|
/** If true, create the replacement before deleting the existing resource. */
|
|
67
67
|
createBeforeReplace?: boolean;
|
|
68
68
|
};
|
|
69
|
-
type ResourceMeta
|
|
70
|
-
type Resource<
|
|
71
|
-
readonly [nodeMetaSymbol]: ResourceMeta
|
|
69
|
+
type ResourceMeta = Meta<'resource', ResourceConfig>;
|
|
70
|
+
type Resource<O extends State = State> = O & {
|
|
71
|
+
readonly [nodeMetaSymbol]: ResourceMeta;
|
|
72
72
|
readonly urn: URN;
|
|
73
73
|
};
|
|
74
74
|
type ResourceClass<I extends State = State, O extends State = State> = {
|
|
75
|
-
new (parent: Group, id: string, props: I, config?: ResourceConfig): Resource<
|
|
76
|
-
get(parent: Group, id: string, physicalId: string): DataSource<
|
|
75
|
+
new (parent: Group, id: string, props: I, config?: ResourceConfig): Resource<O>;
|
|
76
|
+
get(parent: Group, id: string, physicalId: string): DataSource<O>;
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
declare class Stack extends Group {
|
|
@@ -87,31 +87,31 @@ type Tag = 'resource' | 'data';
|
|
|
87
87
|
type State = Record<string, unknown>;
|
|
88
88
|
type Config = {
|
|
89
89
|
/** Specify additional explicit dependencies in addition to the ones in the dependency graph. */
|
|
90
|
-
dependsOn?: Resource
|
|
90
|
+
dependsOn?: Resource[];
|
|
91
91
|
/** Pass an ID of an explicitly configured provider, instead of using the default provider. */
|
|
92
92
|
provider?: string;
|
|
93
93
|
};
|
|
94
|
-
type Meta<T extends Tag = Tag,
|
|
94
|
+
type Meta<T extends Tag = Tag, C extends Config = Config> = {
|
|
95
95
|
readonly tag: T;
|
|
96
96
|
readonly urn: URN;
|
|
97
97
|
readonly logicalId: string;
|
|
98
98
|
readonly type: string;
|
|
99
99
|
readonly stack: Stack;
|
|
100
100
|
readonly provider: string;
|
|
101
|
-
readonly input:
|
|
101
|
+
readonly input: State;
|
|
102
102
|
readonly config?: C;
|
|
103
103
|
readonly dependencies: Set<URN>;
|
|
104
|
-
readonly resolve: (data:
|
|
105
|
-
readonly output: <
|
|
104
|
+
readonly resolve: (data: State) => void;
|
|
105
|
+
readonly output: <V>(cb: (data: State) => V) => Output<V>;
|
|
106
106
|
};
|
|
107
|
-
declare const createMeta: <T extends Tag = Tag,
|
|
107
|
+
declare const createMeta: <T extends Tag = Tag, C extends Config = Config>(tag: T, provider: string, parent: Group, type: string, logicalId: string, input: State, config?: C) => Meta<T, C>;
|
|
108
108
|
|
|
109
|
-
type DataSourceMeta
|
|
110
|
-
type DataSource<
|
|
111
|
-
readonly [nodeMetaSymbol]: DataSourceMeta
|
|
109
|
+
type DataSourceMeta = Meta<'data'>;
|
|
110
|
+
type DataSource<O extends State = State> = {
|
|
111
|
+
readonly [nodeMetaSymbol]: DataSourceMeta;
|
|
112
112
|
readonly urn: URN;
|
|
113
113
|
} & O;
|
|
114
|
-
type DataSourceFunction<I extends State = State, O extends State = State> = (parent: Group, id: string, input: I, config?: Config) => DataSource<
|
|
114
|
+
type DataSourceFunction<I extends State = State, O extends State = State> = (parent: Group, id: string, input: I, config?: Config) => DataSource<O>;
|
|
115
115
|
|
|
116
116
|
declare class Group {
|
|
117
117
|
readonly parent: Group | undefined;
|
package/dist/index.js
CHANGED