@teacss/engine 0.8.5-alpha.3 → 0.9.0-alpha.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,96 @@
1
+ // The facade's `generator.config`: a plain object whose keys follow the oracle `resolveConfig`
2
+ // (core/config.ts:260-288), which spreads the merged config and then sets its own fields.
3
+ import { tsNotReadyError } from "./errors.js";
4
+ /** Fields the TypeScript generator provides; reading one before materialize throws `E_TS_REQUIRED`. */
5
+ export const TS_ONLY_FIELDS = Object.freeze(["configResolved", "extendTheme", "preprocess", "postprocess", "preflights", "autocomplete", "rules", "rulesDynamic", "rulesStaticMap", "variants"]);
6
+ /** Fields copied from the Rust `ResolvedConfigView`. */
7
+ export const VIEW_FIELDS = Object.freeze(["layers", "theme", "shortcuts", "safelist", "blocklist", "separators", "envMode", "unmatched", "shortcutsLayer", "virtualModulePrefix", "mergeSelectors", "warn", "details", "outputToCssLayers", "rulesSize"]);
8
+ /**
9
+ * The keys `resolveConfig` always sets, in its order (config.ts:262-288); `configResolved`,
10
+ * `extendTheme`, `extractorDefault` and `virtualModulePrefix` appear only through the spread.
11
+ */
12
+ const RESOLVED_KEYS = Object.freeze([
13
+ "mergeSelectors",
14
+ "warn",
15
+ "unmatched",
16
+ "outputToCssLayers",
17
+ "sortLayers",
18
+ "blocklist",
19
+ "presets",
20
+ "envMode",
21
+ "shortcutsLayer",
22
+ "layers",
23
+ "theme",
24
+ "rules",
25
+ "rulesSize",
26
+ "rulesDynamic",
27
+ "rulesStaticMap",
28
+ "preprocess",
29
+ "postprocess",
30
+ "preflights",
31
+ "autocomplete",
32
+ "variants",
33
+ "shortcuts",
34
+ "extractors",
35
+ "safelist",
36
+ "separators",
37
+ "details",
38
+ "content",
39
+ "transformers",
40
+ ]);
41
+ export function createConfigView({ view, presets, userConfig, transformers, host, fallback, engine }) {
42
+ const config = {};
43
+ const data = (key, value) => Object.defineProperty(config, key, { value, enumerable: true, configurable: true, writable: true });
44
+ const tsOnly = (key) => Object.defineProperty(config, key, {
45
+ enumerable: true,
46
+ configurable: true,
47
+ get() {
48
+ const ts = fallback.peek();
49
+ if (!ts)
50
+ throw tsNotReadyError(`config.${key}`);
51
+ return ts.config[key];
52
+ },
53
+ });
54
+ const extractors = host.core ? [host.core.extractorSplit] : [{ name: view.extractors?.[0]?.name ?? "@teacss/core/extractor-split" }];
55
+ const fields = {
56
+ presets: () => data("presets", presets),
57
+ content: () => data("content", view.content ?? {}),
58
+ transformers: () => data("transformers", transformers),
59
+ extractors: () => data("extractors", extractors),
60
+ extractorDefault: () => data("extractorDefault", extractors[0]),
61
+ sortLayers: () => data("sortLayers", (layers) => layers),
62
+ };
63
+ for (const key of VIEW_FIELDS)
64
+ fields[key] = () => data(key, view[key]);
65
+ if (engine) {
66
+ // compile-class.ts:84-106 pushes each definition onto `config.shortcuts` and splices it out
67
+ // when its last module drops it; the definitions live in the Engine, so one array is kept in
68
+ // step on every read.
69
+ const shortcuts = [...(view.shortcuts ?? [])];
70
+ const configured = shortcuts.length;
71
+ fields.shortcuts = () => Object.defineProperty(config, "shortcuts", {
72
+ enumerable: true,
73
+ configurable: true,
74
+ get() {
75
+ shortcuts.length = configured;
76
+ shortcuts.push(...engine.compileClassShortcuts());
77
+ return shortcuts;
78
+ },
79
+ });
80
+ }
81
+ for (const key of TS_ONLY_FIELDS)
82
+ fields[key] = () => tsOnly(key);
83
+ for (const key of Object.keys(userConfig ?? {})) {
84
+ if (key === "engine")
85
+ continue;
86
+ if (Object.hasOwn(fields, key))
87
+ fields[key]();
88
+ else
89
+ data(key, userConfig[key]);
90
+ }
91
+ // Redefining a spread key keeps its position, as the object literal does.
92
+ for (const key of RESOLVED_KEYS)
93
+ fields[key]();
94
+ return config;
95
+ }
96
+ //# sourceMappingURL=config-view.js.map
@@ -0,0 +1,22 @@
1
+ /** `@teacss/engine`'s own package.json version; the facade `generator.version` without a host. */
2
+ export declare const ENGINE_PACKAGE_VERSION: string;
3
+ /** `package.json#engineCompat` (v02.11 §7.3); without it `core` is unrestricted and `defaultMode` is `"auto"`. */
4
+ export declare const ENGINE_COMPAT: Readonly<{
5
+ core: string | undefined;
6
+ defaultMode: "opt-in" | "auto";
7
+ oracle: {
8
+ teacssTs: string;
9
+ commit: string;
10
+ } | undefined;
11
+ }>;
12
+ export declare const ENGINE_INSTANCE: unique symbol;
13
+ export declare const ENGINE_MATERIALIZE: unique symbol;
14
+ export declare const ENGINE_STATS: unique symbol;
15
+ export declare const PRESET_OPTIONS: Readonly<{
16
+ standard: symbol;
17
+ icons: symbol;
18
+ official: symbol;
19
+ }>;
20
+ export declare const CONFIG_SOURCE_DECLARATIONS: unique symbol;
21
+ export declare const CONFIG_ENTRY_PROVENANCE: unique symbol;
22
+ //# sourceMappingURL=constants.d.ts.map
@@ -1,24 +1,23 @@
1
- // @ts-check
2
1
  // The facade's symbols and package constants. It imports nothing from the facade, so every
3
- // facade module can import it without a cycle through `index.mjs`.
2
+ // facade module can import it without a cycle through `index.ts`.
4
3
  import { createRequire } from "node:module";
5
-
6
- /** @type {{ version: string, engineCompat?: { core?: string, defaultMode?: "opt-in" | "auto" } }} */
7
4
  const pkg = createRequire(import.meta.url)("../../package.json");
8
-
9
5
  /** `@teacss/engine`'s own package.json version; the facade `generator.version` without a host. */
10
6
  export const ENGINE_PACKAGE_VERSION = pkg.version;
11
-
12
7
  /** `package.json#engineCompat` (v02.11 §7.3); without it `core` is unrestricted and `defaultMode` is `"auto"`. */
13
- export const ENGINE_COMPAT = Object.freeze({ core: pkg.engineCompat?.core, defaultMode: pkg.engineCompat?.defaultMode ?? "auto", oracle: /** @type {any} */ (pkg.engineCompat)?.oracle });
14
-
8
+ export const ENGINE_COMPAT = Object.freeze({
9
+ core: pkg.engineCompat?.core,
10
+ defaultMode: pkg.engineCompat?.defaultMode ?? "auto",
11
+ oracle: pkg.engineCompat?.oracle,
12
+ });
15
13
  export const ENGINE_INSTANCE = Symbol.for("@teacss/engine/instance");
16
14
  export const ENGINE_MATERIALIZE = Symbol.for("@teacss/engine/materialize");
17
15
  export const ENGINE_STATS = Symbol.for("@teacss/engine/stats");
18
16
  export const PRESET_OPTIONS = Object.freeze({
19
- standard: Symbol.for("@teacss/preset-standard/options"),
20
- icons: Symbol.for("@teacss/preset-icons/options"),
21
- official: Symbol.for("@teacss/preset-official/options"),
17
+ standard: Symbol.for("@teacss/preset-standard/options"),
18
+ icons: Symbol.for("@teacss/preset-icons/options"),
19
+ official: Symbol.for("@teacss/preset-official/options"),
22
20
  });
23
21
  export const CONFIG_SOURCE_DECLARATIONS = Symbol.for("@teacss/config/source-declarations");
24
22
  export const CONFIG_ENTRY_PROVENANCE = Symbol.for("@teacss/config/entry-provenance");
23
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,43 @@
1
+ export declare const MAX_RUNTIME_CACHE_ENTRIES = 10000;
2
+ export declare class CountableSet<K> extends Set<K> {
3
+ _map: Map<K, number>;
4
+ constructor(values?: Iterable<K>);
5
+ add(key: K): this;
6
+ delete(key: K): boolean;
7
+ clear(): void;
8
+ getCount(key: K): number;
9
+ setCount(key: K, count: number): this;
10
+ }
11
+ export declare function isCountableSet(value: unknown): value is CountableSet<string>;
12
+ export declare function copyCountableSet<K>(input: CountableSet<K>): CountableSet<K>;
13
+ /**
14
+ * Expands the tokens holding a `{…}` group in place; the parts go to the end, and a counted
15
+ * group's count carries over to each part.
16
+ */
17
+ export declare function expandInputGroups<T extends Set<string>>(tokens: T): T;
18
+ /**
19
+ * The part of the oracle `BoundedMap` the facade uses: ordinary keys are evicted oldest first,
20
+ * retained keys never count toward the limit.
21
+ */
22
+ export declare class BoundedTokenCache<V> extends Map<string, V> {
23
+ #private;
24
+ maxEntries: number;
25
+ retained: Set<string>;
26
+ /** Ordinary keys in insertion order, the order the native map iterates them. */
27
+ order: Set<string>;
28
+ constructor(maxEntries?: number);
29
+ get retainedSize(): number;
30
+ isRetained(key: string): boolean;
31
+ set(key: string, value: V): this;
32
+ delete(key: string): boolean;
33
+ clear(): void;
34
+ /** Replaces the retained entries (bounded-cache.ts:188-205 without the revision check). */
35
+ replaceRetained(entries: Iterable<readonly [string, V]>): void;
36
+ }
37
+ /** FIFO bounded Set (the oracle `BoundedSet` without its `assumeNoPrototypeBypass` fast path). */
38
+ export declare class BoundedSet extends Set<string> {
39
+ maxEntries: number;
40
+ constructor(maxEntries?: number, values?: Iterable<string>);
41
+ add(value: string): this;
42
+ }
43
+ //# sourceMappingURL=countable-set.d.ts.map
@@ -0,0 +1,149 @@
1
+ // Token collections the facade shares with `@teacss/core`: CountableSet (core/utils/countable-set.ts),
2
+ // expandInputGroups (core/generator.ts:517-535) and the FIFO caches of core/bounded-cache.ts.
3
+ import { expandClassGroups, splitClassTokens } from "../../binding.js";
4
+ export const MAX_RUNTIME_CACHE_ENTRIES = 10_000;
5
+ export class CountableSet extends Set {
6
+ _map = new Map();
7
+ constructor(values) {
8
+ super();
9
+ if (values)
10
+ for (const key of values)
11
+ this.add(key);
12
+ }
13
+ add(key) {
14
+ this._map.set(key, (this._map.get(key) ?? 0) + 1);
15
+ return super.add(key);
16
+ }
17
+ delete(key) {
18
+ if (!this._map.has(key))
19
+ return false;
20
+ this._map.delete(key);
21
+ return super.delete(key);
22
+ }
23
+ clear() {
24
+ this._map.clear();
25
+ super.clear();
26
+ }
27
+ getCount(key) {
28
+ return this._map.get(key) ?? 0;
29
+ }
30
+ setCount(key, count) {
31
+ this._map.set(key, count);
32
+ return super.add(key);
33
+ }
34
+ }
35
+ export function isCountableSet(value) {
36
+ return value instanceof CountableSet;
37
+ }
38
+ export function copyCountableSet(input) {
39
+ const copied = new CountableSet();
40
+ for (const key of input)
41
+ copied.setCount(key, input.getCount(key));
42
+ return copied;
43
+ }
44
+ /**
45
+ * Expands the tokens holding a `{…}` group in place; the parts go to the end, and a counted
46
+ * group's count carries over to each part.
47
+ */
48
+ export function expandInputGroups(tokens) {
49
+ const expanded = [...tokens].filter((token) => token.includes("{"));
50
+ if (expanded.length === 0)
51
+ return tokens;
52
+ for (const token of expanded) {
53
+ const parts = splitClassTokens(expandClassGroups(token));
54
+ if (parts.length === 1 && parts[0] === token)
55
+ continue;
56
+ const count = isCountableSet(tokens) ? tokens.getCount(token) : 1;
57
+ tokens.delete(token);
58
+ for (const part of parts) {
59
+ if (isCountableSet(tokens))
60
+ tokens.setCount(part, tokens.getCount(part) + count);
61
+ else
62
+ tokens.add(part);
63
+ }
64
+ }
65
+ return tokens;
66
+ }
67
+ /**
68
+ * The part of the oracle `BoundedMap` the facade uses: ordinary keys are evicted oldest first,
69
+ * retained keys never count toward the limit.
70
+ */
71
+ export class BoundedTokenCache extends Map {
72
+ constructor(maxEntries = MAX_RUNTIME_CACHE_ENTRIES) {
73
+ super();
74
+ this.maxEntries = maxEntries;
75
+ this.retained = new Set();
76
+ this.order = new Set();
77
+ }
78
+ get retainedSize() {
79
+ return this.retained.size;
80
+ }
81
+ isRetained(key) {
82
+ return this.retained.has(key);
83
+ }
84
+ set(key, value) {
85
+ const exists = super.has(key);
86
+ super.set(key, value);
87
+ if (!exists && !this.retained.has(key))
88
+ this.order.add(key);
89
+ this.#enforceLimit();
90
+ return this;
91
+ }
92
+ delete(key) {
93
+ const deleted = super.delete(key);
94
+ this.order.delete(key);
95
+ this.retained.delete(key);
96
+ return deleted;
97
+ }
98
+ clear() {
99
+ super.clear();
100
+ this.order.clear();
101
+ this.retained.clear();
102
+ }
103
+ /** Replaces the retained entries (bounded-cache.ts:188-205 without the revision check). */
104
+ replaceRetained(entries) {
105
+ const next = new Map(entries);
106
+ for (const key of this.retained) {
107
+ if (next.has(key))
108
+ continue;
109
+ super.delete(key);
110
+ this.retained.delete(key);
111
+ }
112
+ for (const [key, value] of next) {
113
+ this.order.delete(key);
114
+ super.set(key, value);
115
+ this.retained.add(key);
116
+ }
117
+ this.#enforceLimit();
118
+ }
119
+ #enforceLimit() {
120
+ while (this.size - this.retained.size > this.maxEntries) {
121
+ const oldest = this.order.values().next();
122
+ if (oldest.done)
123
+ break;
124
+ this.order.delete(oldest.value);
125
+ super.delete(oldest.value);
126
+ }
127
+ }
128
+ }
129
+ /** FIFO bounded Set (the oracle `BoundedSet` without its `assumeNoPrototypeBypass` fast path). */
130
+ export class BoundedSet extends Set {
131
+ constructor(maxEntries = MAX_RUNTIME_CACHE_ENTRIES, values) {
132
+ super();
133
+ this.maxEntries = maxEntries;
134
+ if (values)
135
+ for (const value of values)
136
+ this.add(value);
137
+ }
138
+ add(value) {
139
+ super.add(value);
140
+ while (this.size > this.maxEntries) {
141
+ const oldest = this.values().next();
142
+ if (oldest.done)
143
+ break;
144
+ super.delete(oldest.value);
145
+ }
146
+ return this;
147
+ }
148
+ }
149
+ //# sourceMappingURL=countable-set.js.map
@@ -0,0 +1,11 @@
1
+ /** Errors the facade raises itself; an `Error` from napi (code `E_*`) passes through unwrapped. */
2
+ export declare class TeacssEngineError extends Error {
3
+ code: string;
4
+ details: Record<string, unknown>;
5
+ constructor(code: string, message: string, details?: Record<string, unknown>);
6
+ }
7
+ /** v02.9 §2.1: the member needs `@teacss/core`, which is not installed. */
8
+ export declare function tsRequiredError(member: string): TeacssEngineError;
9
+ /** v02.9 §3.3: the member needs the TypeScript engine, which has not been materialized. */
10
+ export declare function tsNotReadyError(member: string): TeacssEngineError;
11
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1,18 @@
1
+ /** Errors the facade raises itself; an `Error` from napi (code `E_*`) passes through unwrapped. */
2
+ export class TeacssEngineError extends Error {
3
+ constructor(code, message, details = {}) {
4
+ super(message);
5
+ this.name = "TeacssEngineError";
6
+ this.code = code;
7
+ this.details = details;
8
+ }
9
+ }
10
+ /** v02.9 §2.1: the member needs `@teacss/core`, which is not installed. */
11
+ export function tsRequiredError(member) {
12
+ return new TeacssEngineError("E_TS_REQUIRED", `[@teacss/engine] ${member} requires @teacss/core (optional peer) to be installed`, { member });
13
+ }
14
+ /** v02.9 §3.3: the member needs the TypeScript engine, which has not been materialized. */
15
+ export function tsNotReadyError(member) {
16
+ return new TeacssEngineError("E_TS_REQUIRED", `[@teacss/engine] ${member} needs the TypeScript engine; await generator[Symbol.for('@teacss/engine/materialize')]() first or set engine: 'ts'`, { member });
17
+ }
18
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1,153 @@
1
+ import { ENGINE_INSTANCE, ENGINE_MATERIALIZE } from "./constants.js";
2
+ /** Port of core/utils/events.ts:84-112. */
3
+ export declare function createNanoEvents(): {
4
+ events: any;
5
+ emit(event: string, ...args: unknown[]): void;
6
+ on(event: string, cb: Function): () => void;
7
+ };
8
+ /** Port of core/utils/escape.ts:10-72 (CSSOM "serialize an identifier"). */
9
+ export declare function escapeSelector(str: string): string;
10
+ /** generator.ts:3722. */
11
+ export declare function toEscapedSelector(raw: string): string;
12
+ /**
13
+ * v02.9 §8.1: the process-wide counters, the same object the teacss-ts hook updates.
14
+ */
15
+ export declare function engineStats(): {
16
+ rust: number;
17
+ ts: number;
18
+ fallbacks: Record<string, number>;
19
+ };
20
+ /**
21
+ * v02.9 §9: each reason and path prints once per process; the counter grows on every call. A
22
+ * host `report(reason, path, level)` (the hook's consola) replaces the stderr line.
23
+ */
24
+ export declare function reportFallback(reason: string, path: string, host?: FacadeHost, level?: "info" | "warn"): void;
25
+ export declare class FacadeGenerator {
26
+ #private;
27
+ /** The facade's own emitter; a TS backend's `events` are not forwarded. */
28
+ events: {
29
+ events: any;
30
+ emit(event: string, ...args: unknown[]): void;
31
+ on(event: string, cb: Function): () => void;
32
+ };
33
+ userConfig: Record<string, unknown>;
34
+ defaults: Record<string, unknown>;
35
+ /**
36
+ * An `engine` gives a Rust backend and `ts` a TypeScript one.
37
+ */
38
+ constructor({ engine, request, presets, transformers, ts, userConfig, defaults, host, transformer, }: {
39
+ engine?: any;
40
+ request?: object;
41
+ presets?: object[];
42
+ transformers?: object[];
43
+ ts?: any;
44
+ userConfig?: Record<string, unknown>;
45
+ defaults?: Record<string, unknown>;
46
+ host?: {
47
+ core?: any;
48
+ };
49
+ transformer?: object | null;
50
+ });
51
+ get version(): any;
52
+ get config(): any;
53
+ get cache(): any;
54
+ get blocked(): any;
55
+ get parentOrders(): any;
56
+ get activatedRules(): any;
57
+ set cache(value: any);
58
+ set blocked(value: any);
59
+ set parentOrders(value: any);
60
+ set activatedRules(value: any);
61
+ get [ENGINE_INSTANCE](): any;
62
+ /**
63
+ * The two overloads of generator.ts:2037-2040. With an `id` the Engine records the module's
64
+ * tokens; a counted set adds each token's occurrences.
65
+ */
66
+ applyExtractors(code: string, id?: string, extracted?: Set<string>): Promise<any>;
67
+ /**
68
+ * The overloads of generator.ts:2316-2318. String input is extracted here, as Rust's
69
+ * `{ kind: "code" }` would, so its tokens reach the cache and the unmatched check (the oracle
70
+ * runs `applyExtractors` on it, generator.ts:2378).
71
+ */
72
+ generate(input: string | string[] | Set<string>, options?: Record<string, any>): Promise<any>;
73
+ /**
74
+ * generator.ts:2113-2286. A tuple array, or `undefined` for a miss or a blocked token; a miss
75
+ * already cached reads back as `null`. With an `alias` nothing is cached.
76
+ */
77
+ parseToken(raw: string, alias?: string): Promise<any>;
78
+ /** generator.ts:3611. */
79
+ isBlocked(raw: string): any;
80
+ /** generator.ts:3623; the blocklist holds strings only (anything else falls back). */
81
+ getBlocked(raw: string): [string, undefined] | undefined;
82
+ /** generator.ts:2304-2314: cached tokens that emit the same output as `raw`. */
83
+ getCachedEquivalentTokens(raw: string): string[];
84
+ /** The TypeScript generator behind the tooling members, created on first call; a TS backend returns itself. */
85
+ [ENGINE_MATERIALIZE](): Promise<any>;
86
+ /** generator.ts:2105. */
87
+ makeContext(raw: string, applied: unknown): any;
88
+ /** generator.ts:2809. */
89
+ constructCustomCSS(context: unknown, body: unknown, overrideSelector?: string): any;
90
+ /** generator.ts:3160. */
91
+ stringifyUtil(parsed?: unknown, context?: unknown): any;
92
+ /** generator.ts:2635. */
93
+ matchVariants(raw: string, current?: string): Promise<any>;
94
+ /** generator.ts:2866. */
95
+ parseUtil(input: unknown, context: unknown, internal?: boolean, shortcutPrefix?: string | string[]): Promise<any>;
96
+ /** generator.ts:3208. */
97
+ expandShortcut(input: string, context: unknown, depth?: number): Promise<any>;
98
+ /** generator.ts:3409. */
99
+ stringifyShortcuts(parent: unknown, context: unknown, expanded: unknown[], meta?: unknown, matchedPrefixes?: unknown): Promise<any>;
100
+ /** generator.ts:1976-1980: a falsy config keeps the current one. */
101
+ setConfig(userConfig?: Record<string, unknown>, defaults?: Record<string, unknown>): Promise<void>;
102
+ /**
103
+ * generator.ts:1983-2008: a candidate generator for the configuration, without touching this
104
+ * one. A configuration Rust cannot serve gets a TypeScript candidate.
105
+ */
106
+ prepareConfig(userConfig: Record<string, unknown>, defaults?: Record<string, unknown>): Promise<Readonly<{
107
+ config: any;
108
+ defaults: Record<string, unknown>;
109
+ generator: FacadeGenerator;
110
+ userConfig: Record<string, unknown>;
111
+ version: number;
112
+ }>>;
113
+ /**
114
+ * generator.ts:2010-2035: switch to the prepared backend if no newer request superseded it. A
115
+ * superseded Rust candidate is disposed; so is the previous Engine once it is replaced.
116
+ */
117
+ commitConfig(prepared: {
118
+ config: unknown;
119
+ defaults: Record<string, unknown>;
120
+ generator: FacadeGenerator;
121
+ userConfig: Record<string, unknown>;
122
+ version: number;
123
+ }): boolean;
124
+ }
125
+ /**
126
+ * v02.9 §3.1: a Rust facade, or the reason the configuration needs TypeScript. Errors from
127
+ * `loadProject` (`E_*`) are thrown as they are, not turned into a fallback. The hook counts the
128
+ * initial creation, so this does not.
129
+ */
130
+ export interface FacadeHost {
131
+ /** 挂钩注入的 @teacss/core 绑定;缺省时 facade 按需动态 import。 */
132
+ core?: {
133
+ version: string;
134
+ createGenerator: (config?: object, defaults?: object) => Promise<object>;
135
+ createTsGenerator?: (config?: object, defaults?: object) => Promise<object>;
136
+ extractorSplit: object;
137
+ isCountableSet?: (value: unknown) => boolean;
138
+ isTokenShaped?: (token: string) => boolean;
139
+ toEscapedSelector?: (raw: string) => string;
140
+ } | undefined;
141
+ /** 挂钩注入的日志出口;缺省时写 process.stderr。 */
142
+ report?: (reason: string, path: string, level: "info" | "warn") => void;
143
+ }
144
+ export type FacadeCreateResult = {
145
+ ok: true;
146
+ generator: FacadeGenerator;
147
+ } | {
148
+ ok: false;
149
+ reason: string;
150
+ path: string;
151
+ };
152
+ export declare function createGenerator(config?: Record<string, unknown>, defaults?: Record<string, unknown>, host?: FacadeHost): Promise<FacadeCreateResult>;
153
+ //# sourceMappingURL=generator.d.ts.map