@duckmind/dm-darwin-x64 0.36.5 → 0.36.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/dm +0 -0
- package/extensions/.dm-extensions.json +1 -1
- package/extensions/dm-9router-ext/package.json +1 -1
- package/extensions/dm-9router-ext/src/index.ts +1 -1
- package/extensions/dm-ask-user/README.md +3 -3
- package/extensions/dm-ask-user/index.ts +2 -2
- package/extensions/dm-ask-user/package.json +4 -4
- package/extensions/dm-cli-anything/package.json +1 -1
- package/extensions/dm-context/package.json +1 -1
- package/extensions/dm-context/src/context.ts +2 -2
- package/extensions/dm-context/src/index.ts +3 -3
- package/extensions/dm-cua/package.json +2 -2
- package/extensions/dm-goal/package.json +6 -6
- package/extensions/dm-goal/src/commands.ts +1 -1
- package/extensions/dm-goal/src/index.ts +1 -1
- package/extensions/dm-goal/src/tools.ts +2 -2
- package/extensions/dm-goal/test/index.test.ts +1 -1
- package/extensions/dm-image2/index.js +1 -1
- package/extensions/dm-image2/package.json +2 -2
- package/extensions/dm-image2/src/image-lib.mjs +1 -1
- package/extensions/dm-last30days/package.json +1 -1
- package/extensions/dm-subagents/CHANGELOG.md +2 -2
- package/extensions/dm-subagents/node_modules/.package-lock.json +9 -0
- package/extensions/dm-subagents/package-lock.json +136 -2935
- package/extensions/dm-subagents/package.json +6 -6
- package/extensions/dm-subagents/src/agent-manager.ts +2 -2
- package/extensions/dm-subagents/src/agent-record.ts +1 -1
- package/extensions/dm-subagents/src/agent-runner.ts +2 -2
- package/extensions/dm-subagents/src/context.ts +1 -1
- package/extensions/dm-subagents/src/custom-agents.ts +1 -1
- package/extensions/dm-subagents/src/execution-state.ts +1 -1
- package/extensions/dm-subagents/src/index.ts +2 -2
- package/extensions/dm-subagents/src/parent-snapshot.ts +1 -1
- package/extensions/dm-subagents/src/renderer.ts +1 -1
- package/extensions/dm-subagents/src/service-adapter.ts +1 -1
- package/extensions/dm-subagents/src/settings.ts +1 -1
- package/extensions/dm-subagents/src/skill-loader.ts +1 -1
- package/extensions/dm-subagents/src/tools/agent-tool.ts +2 -2
- package/extensions/dm-subagents/src/tools/foreground-runner.ts +1 -1
- package/extensions/dm-subagents/src/tools/get-result-tool.ts +1 -1
- package/extensions/dm-subagents/src/tools/spawn-config.ts +1 -1
- package/extensions/dm-subagents/src/tools/steer-tool.ts +1 -1
- package/extensions/dm-subagents/src/types.ts +1 -1
- package/extensions/dm-subagents/src/ui/agent-config-editor.ts +1 -1
- package/extensions/dm-subagents/src/ui/agent-creation-wizard.ts +1 -1
- package/extensions/dm-subagents/src/ui/agent-menu.ts +1 -1
- package/extensions/dm-subagents/src/ui/conversation-viewer.ts +2 -2
- package/extensions/dm-subagents/src/ui/widget-renderer.ts +1 -1
- package/extensions/dm-subagents/test/agent-runner.test.ts +1 -1
- package/extensions/dm-subagents/test/conversation-viewer.test.ts +6 -6
- package/extensions/dm-subagents/test/custom-agents.test.ts +6 -6
- package/extensions/dm-subagents/test/helpers/mock-session.ts +1 -1
- package/extensions/dm-subagents/test/helpers/stub-ctx.ts +1 -1
- package/extensions/dm-subagents/test/parent-snapshot.test.ts +1 -1
- package/extensions/dm-subagents/test/settings.test.ts +5 -5
- package/extensions/dm-subagents/test/skill-loader.test.ts +5 -5
- package/extensions/dm-subagents/test/unit/subagent-contract.test.ts +5 -3
- package/extensions/dm-tasks/node_modules/.package-lock.json +3 -3
- package/extensions/dm-tasks/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/index.d.mts +6 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/index.mjs +6 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/instantiate.d.mts +38 -21
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/instantiate.mjs +65 -62
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/extensions/dm-tasks/node_modules/typebox/build/type/extends/tuple.mjs +3 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/script/mapping.d.mts +68 -64
- package/extensions/dm-tasks/node_modules/typebox/build/type/script/mapping.mjs +64 -58
- package/extensions/dm-tasks/node_modules/typebox/build/type/script/parser.d.mts +29 -25
- package/extensions/dm-tasks/node_modules/typebox/build/type/script/parser.mjs +15 -13
- package/extensions/dm-tasks/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/extensions/dm-tasks/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/extensions/dm-tasks/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/extensions/dm-tasks/node_modules/typebox/package.json +1 -1
- package/extensions/dm-tasks/package-lock.json +3 -3
- package/extensions/dm-tasks/src/index.ts +1 -1
- package/extensions/dm-tasks/src/ui/settings-menu.ts +2 -2
- package/extensions/dm-tasks/src/ui/task-widget.ts +1 -1
- package/extensions/dm-ultradex/AGENTS.md +2 -2
- package/extensions/dm-ultradex/account-manager.test.ts +1 -1
- package/extensions/dm-ultradex/account-manager.ts +1 -1
- package/extensions/dm-ultradex/auth.ts +1 -1
- package/extensions/dm-ultradex/browser.ts +1 -1
- package/extensions/dm-ultradex/commands.ts +4 -4
- package/extensions/dm-ultradex/extension.ts +2 -2
- package/extensions/dm-ultradex/index.test.ts +5 -3
- package/extensions/dm-ultradex/node_modules/.package-lock.json +9 -0
- package/extensions/dm-ultradex/package-lock.json +130 -2526
- package/extensions/dm-ultradex/package.json +7 -7
- package/extensions/dm-ultradex/provider.ts +2 -2
- package/extensions/dm-ultradex/refresh-race.test.ts +2 -2
- package/extensions/dm-ultradex/status.ts +4 -4
- package/extensions/dm-ultradex/stream-wrapper.ts +1 -1
- package/extensions/dm-usage/index.ts +3 -3
- package/extensions/dm-usage/package.json +4 -4
- package/extensions/greedysearch-dm/index.ts +1 -1
- package/extensions/greedysearch-dm/package-lock.json +2 -2
- package/extensions/greedysearch-dm/package.json +2 -2
- package/extensions/greedysearch-dm/src/tools/greedy-search-handler.ts +2 -2
- package/package.json +1 -1
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/extensions/dm-tasks/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import { Deferred } from '../types/deferred.mjs';
|
|
3
|
+
import { RemoveReadonlyAction } from '../engine/readonly/instantiate_remove.mjs';
|
|
4
|
+
/** Creates a deferred RemoveReadonly action. */
|
|
5
|
+
export function RemoveReadonlyDeferred(type, options = {}) {
|
|
6
|
+
return Deferred('RemoveReadonly', [type], options);
|
|
7
|
+
}
|
|
8
|
+
/** Applies an RemoveReadonly action to a type. */
|
|
9
|
+
export function RemoveReadonly(type, options = {}) {
|
|
10
|
+
return RemoveReadonlyAction(type, options);
|
|
11
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { type TSchema, type TSchemaOptions } from '../types/schema.mjs';
|
|
2
2
|
import { type TDeferred } from '../types/deferred.mjs';
|
|
3
3
|
import { type TConditionalAction } from '../engine/conditional/instantiate.mjs';
|
|
4
|
+
import { type TState } from '../engine/instantiate.mjs';
|
|
4
5
|
/** Creates a deferred Conditional action. */
|
|
5
6
|
export type TConditionalDeferred<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TDeferred<'Conditional', [Left, Right, True, False]>);
|
|
6
7
|
/** Creates a deferred Conditional action. */
|
|
7
8
|
export declare function ConditionalDeferred<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(left: Left, right: Right, true_: True, false_: False, options?: TSchemaOptions): TConditionalDeferred<Left, Right, True, False>;
|
|
8
9
|
/** Applies a Conditional action to the given types. */
|
|
9
|
-
export type TConditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TConditionalAction<{},
|
|
10
|
-
callstack: [];
|
|
11
|
-
}, Left, Right, True, False>);
|
|
10
|
+
export type TConditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TConditionalAction<{}, TState<[], []>, Left, Right, True, False>);
|
|
12
11
|
/** Applies a Conditional action to the given types. */
|
|
13
12
|
export declare function Conditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(left: Left, right: Right, true_: True, false_: False, options?: TSchemaOptions): TConditional<Left, Right, True, False>;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// deno-fmt-ignore-file
|
|
3
3
|
import { Deferred } from '../types/deferred.mjs';
|
|
4
4
|
import { ConditionalAction } from '../engine/conditional/instantiate.mjs';
|
|
5
|
+
import { State } from '../engine/instantiate.mjs';
|
|
5
6
|
/** Creates a deferred Conditional action. */
|
|
6
7
|
export function ConditionalDeferred(left, right, true_, false_, options = {}) {
|
|
7
8
|
return Deferred('Conditional', [left, right, true_, false_], options);
|
|
8
9
|
}
|
|
9
10
|
/** Applies a Conditional action to the given types. */
|
|
10
11
|
export function Conditional(left, right, true_, false_, options = {}) {
|
|
11
|
-
return ConditionalAction({},
|
|
12
|
+
return ConditionalAction({}, State([], []), left, right, true_, false_, options);
|
|
12
13
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './_add_immutable.mjs';
|
|
2
|
+
export * from './_add_readonly.mjs';
|
|
3
|
+
export * from './_add_optional.mjs';
|
|
4
|
+
export * from './_remove_immutable.mjs';
|
|
5
|
+
export * from './_remove_readonly.mjs';
|
|
6
|
+
export * from './_remove_optional.mjs';
|
|
3
7
|
export * from './awaited.mjs';
|
|
4
8
|
export * from './capitalize.mjs';
|
|
5
9
|
export * from './conditional.mjs';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './_add_immutable.mjs';
|
|
2
|
+
export * from './_add_readonly.mjs';
|
|
3
|
+
export * from './_add_optional.mjs';
|
|
4
|
+
export * from './_remove_immutable.mjs';
|
|
5
|
+
export * from './_remove_readonly.mjs';
|
|
6
|
+
export * from './_remove_optional.mjs';
|
|
3
7
|
export * from './awaited.mjs';
|
|
4
8
|
export * from './capitalize.mjs';
|
|
5
9
|
export * from './conditional.mjs';
|
|
@@ -2,13 +2,12 @@ import { type TSchema, type TSchemaOptions } from '../types/schema.mjs';
|
|
|
2
2
|
import { type TIdentifier } from '../types/identifier.mjs';
|
|
3
3
|
import { type TDeferred } from '../types/deferred.mjs';
|
|
4
4
|
import { type TMappedAction } from '../engine/mapped/instantiate.mjs';
|
|
5
|
+
import { type TState } from '../engine/instantiate.mjs';
|
|
5
6
|
/** Creates a deferred Mapped action. */
|
|
6
7
|
export type TMappedDeferred<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TDeferred<'Mapped', [Identifier, Type, As, Property]>);
|
|
7
8
|
/** Creates a deferred Mapped action. */
|
|
8
9
|
export declare function MappedDeferred<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(identifier: Identifier, type: Type, as: As, property: Property, options?: TSchemaOptions): TMappedDeferred<Identifier, Type, As, Property>;
|
|
9
10
|
/** Applies a Mapped action using the given types. */
|
|
10
|
-
export type TMapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TMappedAction<{},
|
|
11
|
-
callstack: [];
|
|
12
|
-
}, Identifier, Type, As, Property>);
|
|
11
|
+
export type TMapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TMappedAction<{}, TState<[], []>, Identifier, Type, As, Property>);
|
|
13
12
|
/** Applies a Mapped action using the given types. */
|
|
14
13
|
export declare function Mapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(identifier: Identifier, type: Type, as: As, property: Property, options?: TSchemaOptions): TMapped<Identifier, Type, As, Property>;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// deno-fmt-ignore-file
|
|
3
3
|
import { Deferred } from '../types/deferred.mjs';
|
|
4
4
|
import { MappedAction } from '../engine/mapped/instantiate.mjs';
|
|
5
|
+
import { State } from '../engine/instantiate.mjs';
|
|
5
6
|
/** Creates a deferred Mapped action. */
|
|
6
7
|
export function MappedDeferred(identifier, type, as, property, options = {}) {
|
|
7
8
|
return Deferred('Mapped', [identifier, type, as, property], options);
|
|
8
9
|
}
|
|
9
10
|
/** Applies a Mapped action using the given types. */
|
|
10
11
|
export function Mapped(identifier, type, as, property, options = {}) {
|
|
11
|
-
return MappedAction({},
|
|
12
|
+
return MappedAction({}, State([], []), identifier, type, as, property, options);
|
|
12
13
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type TSchemaOptions } from '../types/schema.mjs';
|
|
2
2
|
import { type TProperties } from '../types/properties.mjs';
|
|
3
3
|
import { type TDeferred } from '../types/deferred.mjs';
|
|
4
|
-
import { type
|
|
4
|
+
import { type TState } from '../engine/instantiate.mjs';
|
|
5
|
+
import { type TModuleInstantiate } from '../engine/module/instantiate.mjs';
|
|
5
6
|
/** Creates a deferred Module action. */
|
|
6
|
-
export type TModuleDeferred<
|
|
7
|
+
export type TModuleDeferred<Declarations extends TProperties> = (TDeferred<'Module', [Declarations]>);
|
|
7
8
|
/** Creates a deferred Module action. */
|
|
8
|
-
export declare function ModuleDeferred<
|
|
9
|
-
/**
|
|
10
|
-
export type TModule<
|
|
11
|
-
/**
|
|
12
|
-
export declare function Module<
|
|
9
|
+
export declare function ModuleDeferred<Declarations extends TProperties>(declarations: Declarations, options?: TSchemaOptions): TModuleDeferred<Declarations>;
|
|
10
|
+
/** Creates a Module with the given declarations */
|
|
11
|
+
export type TModule<Declarations extends TProperties> = (TModuleInstantiate<{}, TState<[], []>, Declarations>);
|
|
12
|
+
/** Creates a Module with the given declarations */
|
|
13
|
+
export declare function Module<Declarations extends TProperties>(declarations: Declarations, options?: TSchemaOptions): TModule<Declarations>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// deno-lint-ignore-file ban-types
|
|
2
2
|
// deno-fmt-ignore-file
|
|
3
3
|
import { Deferred } from '../types/deferred.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { State } from '../engine/instantiate.mjs';
|
|
5
|
+
import { ModuleInstantiate } from '../engine/module/instantiate.mjs';
|
|
5
6
|
/** Creates a deferred Module action. */
|
|
6
|
-
export function ModuleDeferred(
|
|
7
|
-
return Deferred('Module', [
|
|
7
|
+
export function ModuleDeferred(declarations, options = {}) {
|
|
8
|
+
return Deferred('Module', [declarations], options);
|
|
8
9
|
}
|
|
9
|
-
/**
|
|
10
|
-
export function Module(
|
|
11
|
-
return
|
|
10
|
+
/** Creates a Module with the given declarations */
|
|
11
|
+
export function Module(declarations, options = {}) {
|
|
12
|
+
return ModuleInstantiate({}, State([], []), declarations, options);
|
|
12
13
|
}
|
|
@@ -13,9 +13,7 @@ import { type TResolveTarget } from './resolve_target.mjs';
|
|
|
13
13
|
import { type TResolveArgumentsContext } from './resolve_arguments.mjs';
|
|
14
14
|
type TPeek<State extends TState, Result extends string = State['callstack'] extends [...infer _ extends string[], infer Top extends string] ? Top : ''> = Result;
|
|
15
15
|
type TIsTailCall<State extends TState, Name extends string, Result extends boolean = TPeek<State> extends Name ? true : false> = Result;
|
|
16
|
-
type TCallDispatch<Context extends TProperties, State extends TState, Target extends TRef, Parameters extends TParameter[], Expression extends TSchema, Arguments extends TSchema[], ArgumentsContext extends TProperties = TResolveArgumentsContext<Context, State, Parameters, Arguments>, ReturnType extends TSchema = TInstantiateType<ArgumentsContext,
|
|
17
|
-
callstack: [...State['callstack'], Target['$ref']];
|
|
18
|
-
}, Expression>> = TInstantiateType<Context, State, ReturnType>;
|
|
16
|
+
type TCallDispatch<Context extends TProperties, State extends TState, Target extends TRef, Parameters extends TParameter[], Expression extends TSchema, Arguments extends TSchema[], ArgumentsContext extends TProperties = TResolveArgumentsContext<Context, State, Parameters, Arguments>, ReturnType extends TSchema = TInstantiateType<ArgumentsContext, TState<[...State['callstack'], Target['$ref']], State['visited']>, Expression>> = TInstantiateType<ArgumentsContext, TState<[], []>, ReturnType>;
|
|
19
17
|
type TCallDistributed<Context extends TProperties, State extends TState, Target extends TRef, Parameters extends TParameter[], Expression extends TSchema, DistributedArguments extends TSchema[][], Result extends TSchema[] = []> = (DistributedArguments extends [infer Arguments extends TSchema[], ...infer DistributedArguments extends TSchema[][]] ? TCallDispatch<Context, State, Target, Parameters, Expression, Arguments> extends infer ReturnType extends TSchema ? TCallDistributed<Context, State, Target, Parameters, Expression, DistributedArguments, [...Result, ReturnType]> : never : Result);
|
|
20
18
|
type TCallImmediate<Context extends TProperties, State extends TState, Target extends TRef, Parameters extends TParameter[], Expression extends TSchema, InstantiatedArguments extends TSchema[], DistributedArguments extends TSchema[][] = TDistributeArguments<Parameters, InstantiatedArguments, Expression>, ReturnTypes extends TSchema[] = TCallDistributed<Context, State, Target, Parameters, Expression, DistributedArguments>, Result extends TSchema = ReturnTypes['length'] extends 1 ? ReturnTypes[0] : TEvaluateUnion<ReturnTypes>> = Result;
|
|
21
19
|
export type TCallInstantiate<Context extends TProperties, State extends TState, Target extends TSchema, Arguments extends TSchema[], InstantiatedArguments extends TSchema[] = TInstantiateTypes<Context, State, Arguments>, Resolved extends [string, TSchema] = TResolveTarget<Context, Target, Arguments>, Name extends string = Resolved[0], Type extends TSchema = Resolved[1], Result extends TSchema = (Type extends TGeneric<infer Parameters extends TParameter[], infer Expression extends TSchema> ? TIsTailCall<State, Name> extends true ? TCallConstruct<TRef<Name>, InstantiatedArguments> : TCallImmediate<Context, State, TRef<Name>, Parameters, Expression, InstantiatedArguments> : TCallConstruct<Target, InstantiatedArguments>)> = Result;
|
|
@@ -6,6 +6,7 @@ import { IsGeneric } from '../../types/generic.mjs';
|
|
|
6
6
|
import { EvaluateUnion } from '../evaluate/index.mjs';
|
|
7
7
|
import { InstantiateType } from '../instantiate.mjs';
|
|
8
8
|
import { InstantiateTypes } from '../instantiate.mjs';
|
|
9
|
+
import { State } from '../instantiate.mjs';
|
|
9
10
|
// ------------------------------------------------------------------
|
|
10
11
|
// Infrastructure
|
|
11
12
|
// ------------------------------------------------------------------
|
|
@@ -22,8 +23,8 @@ function IsTailCall(state, name) {
|
|
|
22
23
|
}
|
|
23
24
|
function CallDispatch(context, state, target, parameters, expression, arguments_) {
|
|
24
25
|
const argumentsContext = ResolveArgumentsContext(context, state, parameters, arguments_);
|
|
25
|
-
const returnType = InstantiateType(argumentsContext,
|
|
26
|
-
return InstantiateType(
|
|
26
|
+
const returnType = InstantiateType(argumentsContext, State([...state['callstack'], target['$ref']], state['visited']), expression);
|
|
27
|
+
return InstantiateType(argumentsContext, State([], []), returnType);
|
|
27
28
|
}
|
|
28
29
|
function CallDistributed(context, state, target, parameters, expression, distributedArguments) {
|
|
29
30
|
return distributedArguments.reduce((result, arguments_) => [...result, CallDispatch(context, state, target, parameters, expression, arguments_)], []);
|
|
@@ -3,11 +3,10 @@ import { type TProperties } from '../../types/properties.mjs';
|
|
|
3
3
|
import { type TConstructor } from '../../types/constructor.mjs';
|
|
4
4
|
import { type TTuple } from '../../types/tuple.mjs';
|
|
5
5
|
import { type TConstructorParametersDeferred } from '../../action/constructor_parameters.mjs';
|
|
6
|
-
import { type
|
|
6
|
+
import { type TInstantiateType, type TCanInstantiate } from '../instantiate.mjs';
|
|
7
7
|
import { type TInstantiateElements } from '../instantiate.mjs';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, Parameters>, Result extends TSchema = TTuple<InstantiatedParameters>> = Result;
|
|
8
|
+
import { type TState } from '../instantiate.mjs';
|
|
9
|
+
type TConstructorParametersOperation<Type extends TSchema, Parameters extends TSchema[] = Type extends TConstructor ? Type['parameters'] : [], InstantiatedParameters extends TSchema[] = TInstantiateElements<{}, TState<[], []>, Parameters>, Result extends TSchema = TTuple<InstantiatedParameters>> = Result;
|
|
11
10
|
export type TConstructorParametersAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TConstructorParametersOperation<Type> : TConstructorParametersDeferred<Type>> = Result;
|
|
12
11
|
export declare function ConstructorParametersAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TConstructorParametersAction<Type>;
|
|
13
12
|
export type TConstructorParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TConstructorParametersAction<InstantiatedType>;
|
|
@@ -6,9 +6,10 @@ import { Tuple } from '../../types/tuple.mjs';
|
|
|
6
6
|
import { ConstructorParametersDeferred } from '../../action/constructor_parameters.mjs';
|
|
7
7
|
import { InstantiateType, CanInstantiate } from '../instantiate.mjs';
|
|
8
8
|
import { InstantiateElements } from '../instantiate.mjs';
|
|
9
|
+
import { State } from '../instantiate.mjs';
|
|
9
10
|
function ConstructorParametersOperation(type) {
|
|
10
11
|
const parameters = IsConstructor(type) ? type['parameters'] : [];
|
|
11
|
-
const instantiatedParameters = InstantiateElements({},
|
|
12
|
+
const instantiatedParameters = InstantiateElements({}, State([], []), parameters);
|
|
12
13
|
const result = Tuple(instantiatedParameters);
|
|
13
14
|
return result;
|
|
14
15
|
}
|
|
@@ -6,12 +6,9 @@ import { type TCyclicDependencies } from '../cyclic/dependencies.mjs';
|
|
|
6
6
|
import { type TInterfaceDeferred } from '../../action/index.mjs';
|
|
7
7
|
import { type TInstantiateProperties } from '../instantiate.mjs';
|
|
8
8
|
import { type TInstantiateTypes } from '../instantiate.mjs';
|
|
9
|
+
import { type TState } from '../instantiate.mjs';
|
|
9
10
|
import { type TEvaluateIntersect } from '../evaluate/evaluate.mjs';
|
|
10
|
-
type TCyclicInterface<Context extends TProperties, Heritage extends TSchema[], Properties extends TProperties, InstantiatedHeritage extends TSchema[] = TInstantiateTypes<Context, {
|
|
11
|
-
callstack: [];
|
|
12
|
-
}, Heritage>, instantiatedProperties extends TProperties = TInstantiateProperties<{}, {
|
|
13
|
-
callstack: [];
|
|
14
|
-
}, Properties>, EvaluatedInterface extends TSchema = TEvaluateIntersect<[...InstantiatedHeritage, TObject<instantiatedProperties>]>> = EvaluatedInterface;
|
|
11
|
+
type TCyclicInterface<Context extends TProperties, Heritage extends TSchema[], Properties extends TProperties, InstantiatedHeritage extends TSchema[] = TInstantiateTypes<Context, TState<[], []>, Heritage>, instantiatedProperties extends TProperties = TInstantiateProperties<{}, TState<[], []>, Properties>, EvaluatedInterface extends TSchema = TEvaluateIntersect<[...InstantiatedHeritage, TObject<instantiatedProperties>]>> = EvaluatedInterface;
|
|
15
12
|
type TCyclicDefinitions<Context extends TProperties, Dependencies extends string[], Result extends TProperties = {
|
|
16
13
|
[Key in Extract<keyof Context, Dependencies[number]>]: Context[Key] extends TInterfaceDeferred<infer Heritage extends TSchema[], infer Properties extends TProperties> ? TCyclicInterface<Context, Heritage, Properties> : Context[Key];
|
|
17
14
|
}> = Result;
|
|
@@ -7,10 +7,11 @@ import { CyclicDependencies } from '../cyclic/dependencies.mjs';
|
|
|
7
7
|
import { IsInterfaceDeferred } from '../../action/index.mjs';
|
|
8
8
|
import { InstantiateProperties } from '../instantiate.mjs';
|
|
9
9
|
import { InstantiateTypes } from '../instantiate.mjs';
|
|
10
|
+
import { State } from '../instantiate.mjs';
|
|
10
11
|
import { EvaluateIntersect } from '../evaluate/evaluate.mjs';
|
|
11
12
|
function CyclicInterface(context, heritage, properties) {
|
|
12
|
-
const instantiatedHeritage = InstantiateTypes(context,
|
|
13
|
-
const instantiatedProperties = InstantiateProperties({},
|
|
13
|
+
const instantiatedHeritage = InstantiateTypes(context, State([], []), heritage);
|
|
14
|
+
const instantiatedProperties = InstantiateProperties({}, State([], []), properties);
|
|
14
15
|
const evaluatedInterface = EvaluateIntersect([...instantiatedHeritage, Object(instantiatedProperties)]);
|
|
15
16
|
return evaluatedInterface;
|
|
16
17
|
}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import { type TUnreachable } from '../../../system/unreachable/index.mjs';
|
|
2
|
-
import { type TReadonly
|
|
3
|
-
import { type TOptional
|
|
2
|
+
import { type TReadonly } from '../../types/_readonly.mjs';
|
|
3
|
+
import { type TOptional } from '../../types/_optional.mjs';
|
|
4
4
|
import { type TSchema } from '../../types/schema.mjs';
|
|
5
5
|
import { type TProperties } from '../../types/properties.mjs';
|
|
6
6
|
import { type TObject } from '../../types/object.mjs';
|
|
7
7
|
import { type TNever } from '../../types/never.mjs';
|
|
8
8
|
import { type TTuple } from '../../types/tuple.mjs';
|
|
9
|
+
import { type TAddReadonly } from '../../action/_add_readonly.mjs';
|
|
10
|
+
import { type TAddOptional } from '../../action/_add_optional.mjs';
|
|
11
|
+
import { type TRemoveReadonly } from '../../action/_remove_readonly.mjs';
|
|
12
|
+
import { type TRemoveOptional } from '../../action/_remove_optional.mjs';
|
|
9
13
|
import { type TTupleElementsToProperties } from '../tuple/to_object.mjs';
|
|
10
14
|
import { type TEvaluateIntersect } from './evaluate.mjs';
|
|
11
15
|
type TIsReadonlyProperty<Left extends TSchema, Right extends TSchema> = (Left extends TReadonly<Left> ? Right extends TReadonly<Right> ? true : false : false);
|
|
12
16
|
type TIsOptionalProperty<Left extends TSchema, Right extends TSchema> = (Left extends TOptional<Left> ? Right extends TOptional<Right> ? true : false : false);
|
|
13
|
-
type TCompositeProperty<Left extends TSchema, Right extends TSchema, IsReadonly extends boolean = TIsReadonlyProperty<Left, Right>, IsOptional extends boolean = TIsOptionalProperty<Left, Right>, Evaluated extends TSchema = TEvaluateIntersect<[Left, Right]>, Property extends TSchema =
|
|
17
|
+
type TCompositeProperty<Left extends TSchema, Right extends TSchema, IsReadonly extends boolean = TIsReadonlyProperty<Left, Right>, IsOptional extends boolean = TIsOptionalProperty<Left, Right>, Evaluated extends TSchema = TEvaluateIntersect<[Left, Right]>, Property extends TSchema = TRemoveReadonly<TRemoveOptional<Evaluated>>> = ([
|
|
14
18
|
IsReadonly,
|
|
15
19
|
IsOptional
|
|
16
|
-
] extends [true, true] ?
|
|
20
|
+
] extends [true, true] ? TAddReadonly<TAddOptional<Property>> : [
|
|
17
21
|
IsReadonly,
|
|
18
22
|
IsOptional
|
|
19
|
-
] extends [true, false] ?
|
|
23
|
+
] extends [true, false] ? TAddReadonly<Property> : [
|
|
20
24
|
IsReadonly,
|
|
21
25
|
IsOptional
|
|
22
|
-
] extends [false, true] ?
|
|
26
|
+
] extends [false, true] ? TAddOptional<Property> : Property);
|
|
23
27
|
type TCompositePropertyKey<Left extends TProperties, Right extends TProperties, Key extends PropertyKey, Result extends TSchema = (Key extends keyof Left ? Key extends keyof Right ? TCompositeProperty<Left[Key], Right[Key]> : Left[Key] : Key extends keyof Right ? Right[Key] : TNever)> = Result;
|
|
24
28
|
type TCompositeProperties<Left extends TProperties, Right extends TProperties, Result extends TProperties = {
|
|
25
29
|
[Key in keyof (Right & Left)]: TCompositePropertyKey<Left, Right, Key>;
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
// deno-lint-ignore-file
|
|
3
3
|
import { Unreachable } from '../../../system/unreachable/index.mjs';
|
|
4
4
|
import { Guard } from '../../../guard/index.mjs';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { IsReadonly } from '../../types/_readonly.mjs';
|
|
6
|
+
import { IsOptional } from '../../types/_optional.mjs';
|
|
7
7
|
import { Object, IsObject } from '../../types/object.mjs';
|
|
8
8
|
import { Never } from '../../types/never.mjs';
|
|
9
9
|
import { IsTuple } from '../../types/tuple.mjs';
|
|
10
|
+
import { AddReadonly } from '../../action/_add_readonly.mjs';
|
|
11
|
+
import { AddOptional } from '../../action/_add_optional.mjs';
|
|
12
|
+
import { RemoveReadonly } from '../../action/_remove_readonly.mjs';
|
|
13
|
+
import { RemoveOptional } from '../../action/_remove_optional.mjs';
|
|
10
14
|
import { TupleElementsToProperties } from '../tuple/to_object.mjs';
|
|
11
15
|
import { EvaluateIntersect } from './evaluate.mjs';
|
|
12
16
|
function IsReadonlyProperty(left, right) {
|
|
@@ -20,10 +24,10 @@ function CompositeProperty(left, right) {
|
|
|
20
24
|
const isOptional = IsOptionalProperty(left, right);
|
|
21
25
|
const evaluated = EvaluateIntersect([left, right]);
|
|
22
26
|
// Modifiers need to be discarded and re-applied
|
|
23
|
-
const property =
|
|
24
|
-
return (isReadonly && isOptional ?
|
|
25
|
-
isReadonly && !isOptional ?
|
|
26
|
-
!isReadonly && isOptional ?
|
|
27
|
+
const property = RemoveReadonly(RemoveOptional(evaluated));
|
|
28
|
+
return (isReadonly && isOptional ? AddReadonly(AddOptional(property)) :
|
|
29
|
+
isReadonly && !isOptional ? AddReadonly(property) :
|
|
30
|
+
!isReadonly && isOptional ? AddOptional(property) :
|
|
27
31
|
property);
|
|
28
32
|
}
|
|
29
33
|
function CompositePropertyKey(left, right, key) {
|
package/extensions/dm-tasks/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TSchema, type TSchemaOptions } from '../../types/schema.mjs';
|
|
2
|
+
import { type TProperties } from '../../types/properties.mjs';
|
|
3
|
+
import { type TImmutable } from '../../types/_immutable.mjs';
|
|
4
|
+
import { type TState, type TInstantiateType } from '../instantiate.mjs';
|
|
5
|
+
type TAddImmutableOperation<Type extends TSchema, Result extends TSchema = '~immutable' extends keyof Type ? Type : TImmutable<Type>> = Result;
|
|
6
|
+
export type TAddImmutableAction<Type extends TSchema, Result extends TSchema = TAddImmutableOperation<Type>> = Result;
|
|
7
|
+
export declare function AddImmutableAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TAddImmutableAction<Type>;
|
|
8
|
+
export type TAddImmutableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TAddImmutableAction<InstantiateType>;
|
|
9
|
+
export declare function AddImmutableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TAddImmutableInstantiate<Context, State, Type>;
|
|
10
|
+
export {};
|
package/extensions/dm-tasks/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import { Memory } from '../../../system/memory/index.mjs';
|
|
3
|
+
import { InstantiateType } from '../instantiate.mjs';
|
|
4
|
+
function AddImmutableOperation(type) {
|
|
5
|
+
return Memory.Update(type, { '~immutable': true }, {});
|
|
6
|
+
}
|
|
7
|
+
export function AddImmutableAction(type, options) {
|
|
8
|
+
const result = Memory.Update(AddImmutableOperation(type), {}, options);
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
export function AddImmutableInstantiate(context, state, type, options) {
|
|
12
|
+
const instantiatedType = InstantiateType(context, state, type);
|
|
13
|
+
return AddImmutableAction(instantiatedType, options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TSchema, type TSchemaOptions } from '../../types/schema.mjs';
|
|
2
|
+
import { type TProperties } from '../../types/properties.mjs';
|
|
3
|
+
import { type TImmutable } from '../../types/_immutable.mjs';
|
|
4
|
+
import { type TState, type TInstantiateType } from '../instantiate.mjs';
|
|
5
|
+
type TRemoveImmutableOperation<Type extends TSchema, Result extends TSchema = Type extends TImmutable<infer Type extends TSchema> ? Type : Type> = Result;
|
|
6
|
+
export type TRemoveImmutableAction<Type extends TSchema, Result extends TSchema = TRemoveImmutableOperation<Type>> = Result;
|
|
7
|
+
export declare function RemoveImmutableAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TRemoveImmutableAction<Type>;
|
|
8
|
+
export type TRemoveImmutableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TRemoveImmutableAction<InstantiateType>;
|
|
9
|
+
export declare function RemoveImmutableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TRemoveImmutableInstantiate<Context, State, Type>;
|
|
10
|
+
export {};
|
package/extensions/dm-tasks/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import { Memory } from '../../../system/memory/index.mjs';
|
|
3
|
+
import { InstantiateType } from '../instantiate.mjs';
|
|
4
|
+
function RemoveImmutableOperation(type) {
|
|
5
|
+
return Memory.Discard(type, ['~immutable']);
|
|
6
|
+
}
|
|
7
|
+
export function RemoveImmutableAction(type, options) {
|
|
8
|
+
const result = Memory.Update(RemoveImmutableOperation(type), {}, options);
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
export function RemoveImmutableInstantiate(context, state, type, options) {
|
|
12
|
+
const instantiatedType = InstantiateType(context, state, type);
|
|
13
|
+
return RemoveImmutableAction(instantiatedType, options);
|
|
14
|
+
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { type TImmutable } from '../types/_immutable.mjs';
|
|
2
|
-
import { type TOptional, type TOptionalAdd, type TOptionalRemove } from '../types/_optional.mjs';
|
|
3
|
-
import { type TReadonly, type TReadonlyAdd, type TReadonlyRemove } from '../types/_readonly.mjs';
|
|
4
1
|
import { type TSchema } from '../types/schema.mjs';
|
|
5
2
|
import { type TArray } from '../types/array.mjs';
|
|
6
3
|
import { type TAsyncIterator } from '../types/async_iterator.mjs';
|
|
@@ -20,8 +17,15 @@ import { type TTuple } from '../types/tuple.mjs';
|
|
|
20
17
|
import { type TUnion } from '../types/union.mjs';
|
|
21
18
|
import { type TRef } from '../types/ref.mjs';
|
|
22
19
|
import { type TRest } from '../types/rest.mjs';
|
|
23
|
-
import { type
|
|
24
|
-
import { type
|
|
20
|
+
import { type TAddImmutableInstantiate } from './immutable/instantiate_add.mjs';
|
|
21
|
+
import { type TRemoveImmutableInstantiate } from './immutable/instantiate_remove.mjs';
|
|
22
|
+
import { type TAddReadonlyInstantiate } from './readonly/instantiate_add.mjs';
|
|
23
|
+
import { type TRemoveReadonlyInstantiate } from './readonly/instantiate_remove.mjs';
|
|
24
|
+
import { type TAddOptionalInstantiate } from './optional/instantiate_add.mjs';
|
|
25
|
+
import { type TRemoveOptionalInstantiate } from './optional/instantiate_remove.mjs';
|
|
26
|
+
import { type TOptional } from '../types/_optional.mjs';
|
|
27
|
+
import { type TImmutable } from '../types/_immutable.mjs';
|
|
28
|
+
import { type TReadonly } from '../types/_readonly.mjs';
|
|
25
29
|
import { type TAwaitedInstantiate } from './awaited/instantiate.mjs';
|
|
26
30
|
import { type TCallInstantiate } from './call/instantiate.mjs';
|
|
27
31
|
import { type TCapitalizeInstantiate } from './intrinsics/instantiate.mjs';
|
|
@@ -52,19 +56,13 @@ import { type TUncapitalizeInstantiate } from './intrinsics/instantiate.mjs';
|
|
|
52
56
|
import { type TUppercaseInstantiate } from './intrinsics/instantiate.mjs';
|
|
53
57
|
import { type TWithInstantiate } from './with/instantiate.mjs';
|
|
54
58
|
import { type TRestSpread } from './rest/index.mjs';
|
|
55
|
-
export interface TState {
|
|
56
|
-
callstack:
|
|
59
|
+
export interface TState<CallStack extends string[] = string[], Visited extends string[] = string[]> {
|
|
60
|
+
callstack: CallStack;
|
|
61
|
+
visited: Visited;
|
|
57
62
|
}
|
|
63
|
+
export declare function State<CallStack extends string[], Visited extends string[]>(callstack: CallStack, visited: Visited): TState<CallStack, Visited>;
|
|
58
64
|
export type TCanInstantiate<Types extends TSchema[]> = Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TRef ? false : TCanInstantiate<Right> : true;
|
|
59
65
|
export declare function CanInstantiate<Types extends TSchema[]>(types: [...Types]): TCanInstantiate<Types>;
|
|
60
|
-
type ModifierAction = 'add' | 'remove' | 'none';
|
|
61
|
-
type TModifierActions<Type extends TSchema, Readonly extends ModifierAction, Optional extends ModifierAction> = (Type extends TReadonlyRemoveAction<infer Type extends TSchema> ? TModifierActions<Type, 'remove', Optional> : Type extends TOptionalRemoveAction<infer Type extends TSchema> ? TModifierActions<Type, Readonly, 'remove'> : Type extends TReadonlyAddAction<infer Type extends TSchema> ? TModifierActions<Type, 'add', Optional> : Type extends TOptionalAddAction<infer Type extends TSchema> ? TModifierActions<Type, Readonly, 'add'> : [
|
|
62
|
-
Type,
|
|
63
|
-
Readonly,
|
|
64
|
-
Optional
|
|
65
|
-
]);
|
|
66
|
-
type TApplyReadonly<Action extends ModifierAction, Type extends TSchema> = (Action extends 'remove' ? TReadonlyRemove<Type> : Action extends 'add' ? TReadonlyAdd<Type> : Type);
|
|
67
|
-
type TApplyOptional<Action extends ModifierAction, Type extends TSchema> = (Action extends 'remove' ? TOptionalRemove<Type> : Action extends 'add' ? TOptionalAdd<Type> : Type);
|
|
68
66
|
export type TInstantiateProperties<Context extends TProperties, State extends TState, Properties extends TProperties, Result extends TProperties = {
|
|
69
67
|
[Key in keyof Properties]: TInstantiateType<Context, State, Properties[Key]>;
|
|
70
68
|
}> = Result;
|
|
@@ -76,6 +74,24 @@ export declare function InstantiateTypes<Context extends TProperties, State exte
|
|
|
76
74
|
type TInstantiateDeferred<Context extends TProperties, State extends TState, Action extends string, Parameters extends TSchema[]> = ([
|
|
77
75
|
Action,
|
|
78
76
|
Parameters
|
|
77
|
+
] extends ['AddImmutable', [infer Type extends TSchema]] ? TAddImmutableInstantiate<Context, State, Type> : [
|
|
78
|
+
Action,
|
|
79
|
+
Parameters
|
|
80
|
+
] extends ['RemoveImmutable', [infer Type extends TSchema]] ? TRemoveImmutableInstantiate<Context, State, Type> : [
|
|
81
|
+
Action,
|
|
82
|
+
Parameters
|
|
83
|
+
] extends ['AddReadonly', [infer Type extends TSchema]] ? TAddReadonlyInstantiate<Context, State, Type> : [
|
|
84
|
+
Action,
|
|
85
|
+
Parameters
|
|
86
|
+
] extends ['RemoveReadonly', [infer Type extends TSchema]] ? TRemoveReadonlyInstantiate<Context, State, Type> : [
|
|
87
|
+
Action,
|
|
88
|
+
Parameters
|
|
89
|
+
] extends ['AddOptional', [infer Type extends TSchema]] ? TAddOptionalInstantiate<Context, State, Type> : [
|
|
90
|
+
Action,
|
|
91
|
+
Parameters
|
|
92
|
+
] extends ['RemoveOptional', [infer Type extends TSchema]] ? TRemoveOptionalInstantiate<Context, State, Type> : [
|
|
93
|
+
Action,
|
|
94
|
+
Parameters
|
|
79
95
|
] extends ['Awaited', [infer Type extends TSchema]] ? TAwaitedInstantiate<Context, State, Type> : [
|
|
80
96
|
Action,
|
|
81
97
|
Parameters
|
|
@@ -115,7 +131,7 @@ type TInstantiateDeferred<Context extends TProperties, State extends TState, Act
|
|
|
115
131
|
] extends ['Mapped', [infer Name extends TIdentifier, infer Key extends TSchema, infer As extends TSchema, infer Property extends TSchema]] ? TMappedInstantiate<Context, State, Name, Key, As, Property> : [
|
|
116
132
|
Action,
|
|
117
133
|
Parameters
|
|
118
|
-
] extends ['Module', [infer
|
|
134
|
+
] extends ['Module', [infer Declarations extends TProperties]] ? TModuleInstantiate<Context, State, Declarations> : [
|
|
119
135
|
Action,
|
|
120
136
|
Parameters
|
|
121
137
|
] extends ['NonNullable', [infer Type extends TSchema]] ? TNonNullableInstantiate<Context, State, Type> : [
|
|
@@ -155,12 +171,13 @@ type TInstantiateDeferred<Context extends TProperties, State extends TState, Act
|
|
|
155
171
|
Action,
|
|
156
172
|
Parameters
|
|
157
173
|
] extends ['With', [infer Type extends TSchema, infer Options extends TSchema]] ? TWithInstantiate<Context, State, Type, Options> : TDeferred<Action, Parameters>);
|
|
158
|
-
export type
|
|
159
|
-
export declare function
|
|
174
|
+
export type TInstantiateImmediate<Context extends TProperties, State extends TState, Type extends TSchema, Result extends TSchema = (Type extends TRef<infer Ref extends string> ? TRefInstantiate<Context, State, Type, Ref> : Type extends TArray<infer Type extends TSchema> ? TArray<TInstantiateType<Context, State, Type>> : Type extends TAsyncIterator<infer Type extends TSchema> ? TAsyncIterator<TInstantiateType<Context, State, Type>> : Type extends TCall<infer Target extends TSchema, infer Parameters extends TSchema[]> ? TCallInstantiate<Context, State, Target, Parameters> : Type extends TConstructor<infer Parameters extends TSchema[], infer InstanceType extends TSchema> ? TConstructor<TInstantiateTypes<Context, State, Parameters>, TInstantiateType<Context, State, InstanceType>> : Type extends TDeferred<infer Action extends string, infer Types extends TSchema[]> ? TInstantiateDeferred<Context, State, Action, Types> : Type extends TFunction<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? TFunction<TInstantiateTypes<Context, State, Parameters>, TInstantiateType<Context, State, ReturnType>> : Type extends TDependent<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TDependent<TInstantiateType<Context, State, If>, TInstantiateType<Context, State, Then>, TInstantiateType<Context, State, Else>> : Type extends TIntersect<infer Types extends TSchema[]> ? TIntersect<TInstantiateTypes<Context, State, Types>> : Type extends TIterator<infer Type extends TSchema> ? TIterator<TInstantiateType<Context, State, Type>> : Type extends TObject<infer Properties extends TProperties> ? TObject<TInstantiateProperties<Context, State, Properties>> : Type extends TPromise<infer Type extends TSchema> ? TPromise<TInstantiateType<Context, State, Type>> : Type extends TRecord<infer Key extends string, infer Type extends TSchema> ? TRecord<Key, TInstantiateType<Context, State, Type>> : Type extends TRest<infer Type extends TSchema> ? TRest<TInstantiateType<Context, State, Type>> : Type extends TTuple<infer Types extends TSchema[]> ? TTuple<TInstantiateElements<Context, State, Types>> : Type extends TUnion<infer Types extends TSchema[]> ? TUnion<TInstantiateTypes<Context, State, Types>> : Type)> = Result;
|
|
175
|
+
export declare function InstantiateImmediate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type): TInstantiateImmediate<Context, State, Type>;
|
|
176
|
+
type TWithModifiers<Type extends TSchema, InstantiatedType extends TSchema, WithImmutable extends TSchema = Type extends TImmutable ? TImmutable<InstantiatedType> : InstantiatedType, WithReadonly extends TSchema = Type extends TReadonly ? TReadonly<WithImmutable> : WithImmutable, WithOptional extends TSchema = Type extends TOptional ? TOptional<WithReadonly> : WithReadonly> = WithOptional;
|
|
177
|
+
export type TInstantiateType<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateImmediate<Context, State, Type>, WithModifiers extends TSchema = Type extends TDeferred ? InstantiatedType : TWithModifiers<Type, InstantiatedType>> = WithModifiers;
|
|
178
|
+
export declare function InstantiateType<Context extends TProperties, State extends TState, Type extends TSchema>(context: TProperties, state: TState, type: Type): TInstantiateType<Context, State, Type>;
|
|
160
179
|
/** Instantiates computed schematics using the given context and type. */
|
|
161
|
-
export type TInstantiate<Context extends TProperties, Type extends TSchema> = (TInstantiateType<Context,
|
|
162
|
-
callstack: [];
|
|
163
|
-
}, Type>);
|
|
180
|
+
export type TInstantiate<Context extends TProperties, Type extends TSchema> = (TInstantiateType<Context, TState<[], []>, Type>);
|
|
164
181
|
/** Instantiates computed schematics using the given context and type. */
|
|
165
182
|
export declare function Instantiate<Context extends TProperties, Type extends TSchema>(context: Context, type: Type): TInstantiate<Context, Type>;
|
|
166
183
|
export {};
|