@gtkx/codegen 0.21.0
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/LICENSE +373 -0
- package/dist/dsl/context.d.ts +104 -0
- package/dist/dsl/context.d.ts.map +1 -0
- package/dist/dsl/context.js +140 -0
- package/dist/dsl/context.js.map +1 -0
- package/dist/dsl/emit.d.ts +28 -0
- package/dist/dsl/emit.d.ts.map +1 -0
- package/dist/dsl/emit.js +41 -0
- package/dist/dsl/emit.js.map +1 -0
- package/dist/dsl/identifier.d.ts +28 -0
- package/dist/dsl/identifier.d.ts.map +1 -0
- package/dist/dsl/identifier.js +45 -0
- package/dist/dsl/identifier.js.map +1 -0
- package/dist/dsl/imports.d.ts +58 -0
- package/dist/dsl/imports.d.ts.map +1 -0
- package/dist/dsl/imports.js +107 -0
- package/dist/dsl/imports.js.map +1 -0
- package/dist/dsl/module.d.ts +53 -0
- package/dist/dsl/module.d.ts.map +1 -0
- package/dist/dsl/module.js +76 -0
- package/dist/dsl/module.js.map +1 -0
- package/dist/ffi/pipeline.d.ts +19 -0
- package/dist/ffi/pipeline.d.ts.map +1 -0
- package/dist/ffi/pipeline.js +107 -0
- package/dist/ffi/pipeline.js.map +1 -0
- package/dist/fingerprint.d.ts +30 -0
- package/dist/fingerprint.d.ts.map +1 -0
- package/dist/fingerprint.js +33 -0
- package/dist/fingerprint.js.map +1 -0
- package/dist/gi-store.d.ts +34 -0
- package/dist/gi-store.d.ts.map +1 -0
- package/dist/gi-store.js +154 -0
- package/dist/gi-store.js.map +1 -0
- package/dist/gir/boxed.d.ts +66 -0
- package/dist/gir/boxed.d.ts.map +1 -0
- package/dist/gir/boxed.js +49 -0
- package/dist/gir/boxed.js.map +1 -0
- package/dist/gir/callback.d.ts +15 -0
- package/dist/gir/callback.d.ts.map +1 -0
- package/dist/gir/callback.js +17 -0
- package/dist/gir/callback.js.map +1 -0
- package/dist/gir/class.d.ts +49 -0
- package/dist/gir/class.d.ts.map +1 -0
- package/dist/gir/class.js +42 -0
- package/dist/gir/class.js.map +1 -0
- package/dist/gir/enum.d.ts +39 -0
- package/dist/gir/enum.d.ts.map +1 -0
- package/dist/gir/enum.js +24 -0
- package/dist/gir/enum.js.map +1 -0
- package/dist/gir/field.d.ts +27 -0
- package/dist/gir/field.d.ts.map +1 -0
- package/dist/gir/field.js +19 -0
- package/dist/gir/field.js.map +1 -0
- package/dist/gir/function.d.ts +47 -0
- package/dist/gir/function.d.ts.map +1 -0
- package/dist/gir/function.js +28 -0
- package/dist/gir/function.js.map +1 -0
- package/dist/gir/namespace.d.ts +65 -0
- package/dist/gir/namespace.d.ts.map +1 -0
- package/dist/gir/namespace.js +60 -0
- package/dist/gir/namespace.js.map +1 -0
- package/dist/gir/parameter.d.ts +82 -0
- package/dist/gir/parameter.d.ts.map +1 -0
- package/dist/gir/parameter.js +66 -0
- package/dist/gir/parameter.js.map +1 -0
- package/dist/gir/parse.d.ts +78 -0
- package/dist/gir/parse.d.ts.map +1 -0
- package/dist/gir/parse.js +155 -0
- package/dist/gir/parse.js.map +1 -0
- package/dist/gir/primitives.d.ts +36 -0
- package/dist/gir/primitives.d.ts.map +1 -0
- package/dist/gir/primitives.js +109 -0
- package/dist/gir/primitives.js.map +1 -0
- package/dist/gir/property.d.ts +29 -0
- package/dist/gir/property.d.ts.map +1 -0
- package/dist/gir/property.js +16 -0
- package/dist/gir/property.js.map +1 -0
- package/dist/gir/qualified-name.d.ts +37 -0
- package/dist/gir/qualified-name.d.ts.map +1 -0
- package/dist/gir/qualified-name.js +39 -0
- package/dist/gir/qualified-name.js.map +1 -0
- package/dist/gir/qualify.d.ts +32 -0
- package/dist/gir/qualify.d.ts.map +1 -0
- package/dist/gir/qualify.js +60 -0
- package/dist/gir/qualify.js.map +1 -0
- package/dist/gir/repository.d.ts +82 -0
- package/dist/gir/repository.d.ts.map +1 -0
- package/dist/gir/repository.js +122 -0
- package/dist/gir/repository.js.map +1 -0
- package/dist/gir/signal.d.ts +22 -0
- package/dist/gir/signal.d.ts.map +1 -0
- package/dist/gir/signal.js +20 -0
- package/dist/gir/signal.js.map +1 -0
- package/dist/gir/size.d.ts +67 -0
- package/dist/gir/size.d.ts.map +1 -0
- package/dist/gir/size.js +87 -0
- package/dist/gir/size.js.map +1 -0
- package/dist/gir/type-ref.d.ts +79 -0
- package/dist/gir/type-ref.d.ts.map +1 -0
- package/dist/gir/type-ref.js +101 -0
- package/dist/gir/type-ref.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-store.d.ts +22 -0
- package/dist/jsx-store.d.ts.map +1 -0
- package/dist/jsx-store.js +40 -0
- package/dist/jsx-store.js.map +1 -0
- package/dist/react/compounds-meta.d.ts +18 -0
- package/dist/react/compounds-meta.d.ts.map +1 -0
- package/dist/react/compounds-meta.js +93 -0
- package/dist/react/compounds-meta.js.map +1 -0
- package/dist/react/compounds.d.ts +27 -0
- package/dist/react/compounds.d.ts.map +1 -0
- package/dist/react/compounds.js +164 -0
- package/dist/react/compounds.js.map +1 -0
- package/dist/react/internal.d.ts +14 -0
- package/dist/react/internal.d.ts.map +1 -0
- package/dist/react/internal.js +79 -0
- package/dist/react/internal.js.map +1 -0
- package/dist/react/jsx.d.ts +22 -0
- package/dist/react/jsx.d.ts.map +1 -0
- package/dist/react/jsx.js +134 -0
- package/dist/react/jsx.js.map +1 -0
- package/dist/react/pipeline.d.ts +13 -0
- package/dist/react/pipeline.d.ts.map +1 -0
- package/dist/react/pipeline.js +25 -0
- package/dist/react/pipeline.js.map +1 -0
- package/dist/react/props.d.ts +38 -0
- package/dist/react/props.d.ts.map +1 -0
- package/dist/react/props.js +231 -0
- package/dist/react/props.js.map +1 -0
- package/dist/react/slot-props.d.ts +10 -0
- package/dist/react/slot-props.d.ts.map +1 -0
- package/dist/react/slot-props.js +56 -0
- package/dist/react/slot-props.js.map +1 -0
- package/dist/react/widgets.d.ts +83 -0
- package/dist/react/widgets.d.ts.map +1 -0
- package/dist/react/widgets.js +152 -0
- package/dist/react/widgets.js.map +1 -0
- package/dist/runner.d.ts +55 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +60 -0
- package/dist/runner.js.map +1 -0
- package/dist/store-fs.d.ts +109 -0
- package/dist/store-fs.d.ts.map +1 -0
- package/dist/store-fs.js +98 -0
- package/dist/store-fs.js.map +1 -0
- package/dist/transpile.d.ts +32 -0
- package/dist/transpile.d.ts.map +1 -0
- package/dist/transpile.js +63 -0
- package/dist/transpile.js.map +1 -0
- package/dist/typecheck-store.d.ts +41 -0
- package/dist/typecheck-store.d.ts.map +1 -0
- package/dist/typecheck-store.js +102 -0
- package/dist/typecheck-store.js.map +1 -0
- package/dist/writers/alias.d.ts +13 -0
- package/dist/writers/alias.d.ts.map +1 -0
- package/dist/writers/alias.js +17 -0
- package/dist/writers/alias.js.map +1 -0
- package/dist/writers/async.d.ts +22 -0
- package/dist/writers/async.d.ts.map +1 -0
- package/dist/writers/async.js +48 -0
- package/dist/writers/async.js.map +1 -0
- package/dist/writers/boxed-constructor.d.ts +26 -0
- package/dist/writers/boxed-constructor.d.ts.map +1 -0
- package/dist/writers/boxed-constructor.js +85 -0
- package/dist/writers/boxed-constructor.js.map +1 -0
- package/dist/writers/boxed-field-accessor.d.ts +18 -0
- package/dist/writers/boxed-field-accessor.d.ts.map +1 -0
- package/dist/writers/boxed-field-accessor.js +260 -0
- package/dist/writers/boxed-field-accessor.js.map +1 -0
- package/dist/writers/boxed-layout.d.ts +27 -0
- package/dist/writers/boxed-layout.d.ts.map +1 -0
- package/dist/writers/boxed-layout.js +128 -0
- package/dist/writers/boxed-layout.js.map +1 -0
- package/dist/writers/boxed.d.ts +20 -0
- package/dist/writers/boxed.d.ts.map +1 -0
- package/dist/writers/boxed.js +71 -0
- package/dist/writers/boxed.js.map +1 -0
- package/dist/writers/callables.d.ts +124 -0
- package/dist/writers/callables.d.ts.map +1 -0
- package/dist/writers/callables.js +283 -0
- package/dist/writers/callables.js.map +1 -0
- package/dist/writers/callback.d.ts +16 -0
- package/dist/writers/callback.d.ts.map +1 -0
- package/dist/writers/callback.js +38 -0
- package/dist/writers/callback.js.map +1 -0
- package/dist/writers/class-struct-record.d.ts +31 -0
- package/dist/writers/class-struct-record.d.ts.map +1 -0
- package/dist/writers/class-struct-record.js +67 -0
- package/dist/writers/class-struct-record.js.map +1 -0
- package/dist/writers/class-struct.d.ts +22 -0
- package/dist/writers/class-struct.d.ts.map +1 -0
- package/dist/writers/class-struct.js +85 -0
- package/dist/writers/class-struct.js.map +1 -0
- package/dist/writers/class.d.ts +16 -0
- package/dist/writers/class.d.ts.map +1 -0
- package/dist/writers/class.js +307 -0
- package/dist/writers/class.js.map +1 -0
- package/dist/writers/constant.d.ts +15 -0
- package/dist/writers/constant.d.ts.map +1 -0
- package/dist/writers/constant.js +23 -0
- package/dist/writers/constant.js.map +1 -0
- package/dist/writers/constants.d.ts +15 -0
- package/dist/writers/constants.d.ts.map +1 -0
- package/dist/writers/constants.js +23 -0
- package/dist/writers/constants.js.map +1 -0
- package/dist/writers/constructor-props.d.ts +32 -0
- package/dist/writers/constructor-props.d.ts.map +1 -0
- package/dist/writers/constructor-props.js +110 -0
- package/dist/writers/constructor-props.js.map +1 -0
- package/dist/writers/enum.d.ts +21 -0
- package/dist/writers/enum.d.ts.map +1 -0
- package/dist/writers/enum.js +48 -0
- package/dist/writers/enum.js.map +1 -0
- package/dist/writers/function.d.ts +40 -0
- package/dist/writers/function.d.ts.map +1 -0
- package/dist/writers/function.js +127 -0
- package/dist/writers/function.js.map +1 -0
- package/dist/writers/gtype-binding.d.ts +19 -0
- package/dist/writers/gtype-binding.d.ts.map +1 -0
- package/dist/writers/gtype-binding.js +40 -0
- package/dist/writers/gtype-binding.js.map +1 -0
- package/dist/writers/inheritance.d.ts +48 -0
- package/dist/writers/inheritance.d.ts.map +1 -0
- package/dist/writers/inheritance.js +90 -0
- package/dist/writers/inheritance.js.map +1 -0
- package/dist/writers/interface.d.ts +16 -0
- package/dist/writers/interface.d.ts.map +1 -0
- package/dist/writers/interface.js +155 -0
- package/dist/writers/interface.js.map +1 -0
- package/dist/writers/method.d.ts +150 -0
- package/dist/writers/method.d.ts.map +1 -0
- package/dist/writers/method.js +510 -0
- package/dist/writers/method.js.map +1 -0
- package/dist/writers/param-classify.d.ts +93 -0
- package/dist/writers/param-classify.d.ts.map +1 -0
- package/dist/writers/param-classify.js +163 -0
- package/dist/writers/param-classify.js.map +1 -0
- package/dist/writers/property-accessor.d.ts +19 -0
- package/dist/writers/property-accessor.d.ts.map +1 -0
- package/dist/writers/property-accessor.js +117 -0
- package/dist/writers/property-accessor.js.map +1 -0
- package/dist/writers/registration.d.ts +27 -0
- package/dist/writers/registration.d.ts.map +1 -0
- package/dist/writers/registration.js +30 -0
- package/dist/writers/registration.js.map +1 -0
- package/dist/writers/return-wrap.d.ts +39 -0
- package/dist/writers/return-wrap.d.ts.map +1 -0
- package/dist/writers/return-wrap.js +152 -0
- package/dist/writers/return-wrap.js.map +1 -0
- package/dist/writers/runtime-override.d.ts +18 -0
- package/dist/writers/runtime-override.d.ts.map +1 -0
- package/dist/writers/runtime-override.js +44 -0
- package/dist/writers/runtime-override.js.map +1 -0
- package/dist/writers/signal.d.ts +21 -0
- package/dist/writers/signal.d.ts.map +1 -0
- package/dist/writers/signal.js +260 -0
- package/dist/writers/signal.js.map +1 -0
- package/dist/writers/ts-type.d.ts +50 -0
- package/dist/writers/ts-type.d.ts.map +1 -0
- package/dist/writers/ts-type.js +75 -0
- package/dist/writers/ts-type.js.map +1 -0
- package/dist/writers/types-ts.d.ts +27 -0
- package/dist/writers/types-ts.d.ts.map +1 -0
- package/dist/writers/types-ts.js +97 -0
- package/dist/writers/types-ts.js.map +1 -0
- package/dist/writers/value.d.ts +89 -0
- package/dist/writers/value.d.ts.map +1 -0
- package/dist/writers/value.js +402 -0
- package/dist/writers/value.js.map +1 -0
- package/package.json +55 -0
- package/src/dsl/context.ts +146 -0
- package/src/dsl/emit.ts +42 -0
- package/src/dsl/identifier.ts +52 -0
- package/src/dsl/imports.ts +109 -0
- package/src/dsl/module.ts +75 -0
- package/src/ffi/pipeline.ts +113 -0
- package/src/fingerprint.ts +50 -0
- package/src/gi-store.ts +199 -0
- package/src/gir/boxed.ts +94 -0
- package/src/gir/callback.ts +26 -0
- package/src/gir/class.ts +79 -0
- package/src/gir/enum.ts +55 -0
- package/src/gir/field.ts +40 -0
- package/src/gir/function.ts +67 -0
- package/src/gir/namespace.ts +118 -0
- package/src/gir/parameter.ts +120 -0
- package/src/gir/parse.ts +171 -0
- package/src/gir/primitives.ts +137 -0
- package/src/gir/property.ts +39 -0
- package/src/gir/qualified-name.ts +55 -0
- package/src/gir/qualify.ts +64 -0
- package/src/gir/repository.ts +149 -0
- package/src/gir/signal.ts +36 -0
- package/src/gir/size.ts +129 -0
- package/src/gir/type-ref.ts +180 -0
- package/src/index.ts +16 -0
- package/src/jsx-store.ts +53 -0
- package/src/react/compounds-meta.ts +99 -0
- package/src/react/compounds.ts +204 -0
- package/src/react/internal.ts +91 -0
- package/src/react/jsx.ts +155 -0
- package/src/react/pipeline.ts +29 -0
- package/src/react/props.ts +307 -0
- package/src/react/slot-props.ts +57 -0
- package/src/react/widgets.ts +185 -0
- package/src/runner.ts +89 -0
- package/src/store-fs.ts +157 -0
- package/src/transpile.ts +80 -0
- package/src/typecheck-store.ts +136 -0
- package/src/writers/alias.ts +19 -0
- package/src/writers/async.ts +44 -0
- package/src/writers/boxed-constructor.ts +105 -0
- package/src/writers/boxed-field-accessor.ts +306 -0
- package/src/writers/boxed-layout.ts +166 -0
- package/src/writers/boxed.ts +77 -0
- package/src/writers/callables.ts +339 -0
- package/src/writers/callback.ts +40 -0
- package/src/writers/class-struct-record.ts +75 -0
- package/src/writers/class-struct.ts +96 -0
- package/src/writers/class.ts +384 -0
- package/src/writers/constant.ts +29 -0
- package/src/writers/constructor-props.ts +130 -0
- package/src/writers/enum.ts +53 -0
- package/src/writers/function.ts +136 -0
- package/src/writers/gtype-binding.ts +48 -0
- package/src/writers/inheritance.ts +104 -0
- package/src/writers/interface.ts +168 -0
- package/src/writers/method.ts +678 -0
- package/src/writers/param-classify.ts +178 -0
- package/src/writers/property-accessor.ts +139 -0
- package/src/writers/registration.ts +42 -0
- package/src/writers/return-wrap.ts +180 -0
- package/src/writers/runtime-override.ts +59 -0
- package/src/writers/signal.ts +318 -0
- package/src/writers/ts-type.ts +115 -0
- package/src/writers/value.ts +485 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
import { toCamelCase } from "@gtkx/utils";
|
|
2
|
+
import { isCallerAllocatedOut, isInoutParameter, isOutParameter } from "../gir/parameter.js";
|
|
3
|
+
import { qualifyTypeRef } from "../gir/qualify.js";
|
|
4
|
+
import { arrayLengthSources, closureAndDestroyIndices, inputParameters, isCollectibleCallerOut, isHandlePassing, parameterIdentifier, returnArrayLengthIndices, } from "./param-classify.js";
|
|
5
|
+
import { handleCast, wrapReturnValue } from "./return-wrap.js";
|
|
6
|
+
import { renderTsType } from "./ts-type.js";
|
|
7
|
+
import { isCellInout, resolveCallbackType } from "./value.js";
|
|
8
|
+
/**
|
|
9
|
+
* Returns the camelCased JS export name for a callable's method or static.
|
|
10
|
+
*
|
|
11
|
+
* @param fn - The callable
|
|
12
|
+
*/
|
|
13
|
+
export const methodExportName = (fn) => toCamelCase(fn.name);
|
|
14
|
+
/**
|
|
15
|
+
* Renders the TypeScript parameter list for a callable.
|
|
16
|
+
*
|
|
17
|
+
* Drops out-only parameters, `<varargs>` slots, and array-length
|
|
18
|
+
* parameters whose value is computed from a sibling array's `.length`.
|
|
19
|
+
* Names follow `toCamelCase` of the GIR name, falling back to
|
|
20
|
+
* `arg<index>` for unnamed positions.
|
|
21
|
+
*
|
|
22
|
+
* @param context - The module context
|
|
23
|
+
* @param fn - The callable
|
|
24
|
+
*/
|
|
25
|
+
export const renderMethodSignature = (context, fn) => renderInputParameters(context, fn, () => false, () => false);
|
|
26
|
+
const renderInputParameters = (context, fn, skip, isOptionalExtra) => {
|
|
27
|
+
const parts = [];
|
|
28
|
+
let sawOptional = false;
|
|
29
|
+
for (const { parameter, index } of inputParameters(fn)) {
|
|
30
|
+
if (skip(parameter))
|
|
31
|
+
continue;
|
|
32
|
+
const name = parameterIdentifier(parameter, index);
|
|
33
|
+
if (parameter.optional || isOptionalExtra(parameter)) {
|
|
34
|
+
sawOptional = true;
|
|
35
|
+
}
|
|
36
|
+
const annotation = renderTsType(context, parameter.type, parameter.nullable);
|
|
37
|
+
parts.push(sawOptional ? `${name}?: ${annotation}` : `${name}: ${annotation}`);
|
|
38
|
+
}
|
|
39
|
+
return parts.join(", ");
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Renders the TypeScript return-type annotation for a callable.
|
|
43
|
+
*
|
|
44
|
+
* Multi-out callables tuple the primary return with each out-parameter
|
|
45
|
+
* (`[primary, ...outs]`); when the primary return is void the tuple
|
|
46
|
+
* starts at the first out-parameter.
|
|
47
|
+
*
|
|
48
|
+
* @param context - The module context
|
|
49
|
+
* @param fn - The callable
|
|
50
|
+
*/
|
|
51
|
+
export const renderMethodReturnType = (context, fn) => {
|
|
52
|
+
const consumedByReturn = returnArrayLengthIndices(fn);
|
|
53
|
+
const outs = fn.parameters.filter((p, index) => (isOutParameter(p) ||
|
|
54
|
+
(isCallerAllocatedOut(p) && isCollectibleCallerOut(context, p)) ||
|
|
55
|
+
isInoutParameter(p)) &&
|
|
56
|
+
!consumedByReturn.has(index));
|
|
57
|
+
const primaryReturnsValue = !isVoidReturn(fn);
|
|
58
|
+
if (outs.length === 0) {
|
|
59
|
+
return primaryReturnsValue ? renderTsType(context, fn.returnValue.type, fn.returnValue.nullable) : "void";
|
|
60
|
+
}
|
|
61
|
+
const outTypes = outs.map((parameter) => renderTsType(context, parameter.type, false));
|
|
62
|
+
if (!primaryReturnsValue) {
|
|
63
|
+
return outTypes.length === 1 ? `${outTypes[0]}` : `[${outTypes.join(", ")}]`;
|
|
64
|
+
}
|
|
65
|
+
const primary = renderTsType(context, fn.returnValue.type, fn.returnValue.nullable);
|
|
66
|
+
return `[${primary}, ${outTypes.join(", ")}]`;
|
|
67
|
+
};
|
|
68
|
+
const isVoidReturn = (fn) => {
|
|
69
|
+
const ref = fn.returnValue.type;
|
|
70
|
+
if (ref === undefined)
|
|
71
|
+
return true;
|
|
72
|
+
return ref.kind === "primitive" && ref.category === "void";
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Renders the JS body of a promisified `*_async` method that delegates to
|
|
76
|
+
* the runtime's `promisify` helper.
|
|
77
|
+
*
|
|
78
|
+
* The method's leading FFI args (everything before the `GCancellable*`
|
|
79
|
+
* slot) and the cancellable parameter are extracted from the GIR `*_async`
|
|
80
|
+
* signature; the trailing `GAsyncReadyCallback` slot is filled by
|
|
81
|
+
* `promisify`. The `*_finish` companion is bound from the same class via
|
|
82
|
+
* `this[finishName].bind(this)`.
|
|
83
|
+
*
|
|
84
|
+
* @param context - The module context
|
|
85
|
+
* @param asyncFn - The `*_async` callable
|
|
86
|
+
* @param finishMember - The camelCase JS name of the companion `*_finish` method
|
|
87
|
+
* @param bindingExpression - Expression that evaluates to the bound async `t.fn` callable
|
|
88
|
+
*/
|
|
89
|
+
export const renderPromisifiedBody = (context, asyncFn, finishMember, bindingExpression) => {
|
|
90
|
+
context.addRuntimeImport("promisify");
|
|
91
|
+
const cancellableIndex = findCancellableIndex(asyncFn.parameters);
|
|
92
|
+
const closureIndices = closureAndDestroyIndices(asyncFn);
|
|
93
|
+
const lengthFor = arrayLengthSources(asyncFn);
|
|
94
|
+
const leadingExpressions = [];
|
|
95
|
+
if (asyncFn.instance !== undefined) {
|
|
96
|
+
context.addRuntimeImport("getHandle");
|
|
97
|
+
leadingExpressions.push("getHandle(this)");
|
|
98
|
+
}
|
|
99
|
+
let cancellableExpression = "null";
|
|
100
|
+
asyncFn.parameters.forEach((parameter, index) => {
|
|
101
|
+
if (parameter.isVarargs)
|
|
102
|
+
return;
|
|
103
|
+
if (index === cancellableIndex) {
|
|
104
|
+
cancellableExpression = parameterIdentifier(parameter, index);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (isCallbackParameter(context, parameter))
|
|
108
|
+
return;
|
|
109
|
+
if (closureIndices.has(index))
|
|
110
|
+
return;
|
|
111
|
+
const sourceIndex = lengthFor.get(index);
|
|
112
|
+
if (sourceIndex !== undefined) {
|
|
113
|
+
const source = asyncFn.parameters[sourceIndex];
|
|
114
|
+
if (source !== undefined) {
|
|
115
|
+
leadingExpressions.push(`${parameterIdentifier(source, sourceIndex)}.length`);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
leadingExpressions.push(parameterCallExpression(context, parameter, index));
|
|
120
|
+
});
|
|
121
|
+
const leadingLiteral = `[${leadingExpressions.join(", ")}]`;
|
|
122
|
+
return `return promisify(${bindingExpression}, this.${finishMember}.bind(this), ${cancellableExpression}, { leading: ${leadingLiteral} });`;
|
|
123
|
+
};
|
|
124
|
+
const findCancellableIndex = (parameters) => {
|
|
125
|
+
for (let index = 0; index < parameters.length; index += 1) {
|
|
126
|
+
const parameter = parameters[index];
|
|
127
|
+
if (parameter === undefined)
|
|
128
|
+
continue;
|
|
129
|
+
if (parameter.type?.kind !== "named")
|
|
130
|
+
continue;
|
|
131
|
+
if (parameter.type.typeName === "Cancellable")
|
|
132
|
+
return index;
|
|
133
|
+
}
|
|
134
|
+
return -1;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Renders the TypeScript signature for a promisified `*_async` method.
|
|
138
|
+
*
|
|
139
|
+
* The signature drops the trailing `GAsyncReadyCallback` and `gpointer
|
|
140
|
+
* user_data` slots, marks the cancellable optional, and returns a
|
|
141
|
+
* `Promise` wrapping the finish method's return type.
|
|
142
|
+
*
|
|
143
|
+
* @param context - The module context
|
|
144
|
+
* @param asyncFn - The `*_async` callable
|
|
145
|
+
* @param finishFn - The companion `*_finish` callable
|
|
146
|
+
*/
|
|
147
|
+
export const renderPromisifiedSignature = (context, asyncFn, finishFn) => {
|
|
148
|
+
const signature = renderInputParameters(context, asyncFn, (parameter) => isCallbackParameter(context, parameter), isCancellable);
|
|
149
|
+
const finishReturn = renderMethodReturnType(context, finishFn);
|
|
150
|
+
return { signature, returnType: `Promise<${finishReturn}>` };
|
|
151
|
+
};
|
|
152
|
+
const isCancellable = (parameter) => parameter.type?.kind === "named" && parameter.type.typeName === "Cancellable";
|
|
153
|
+
const isCallbackParameter = (context, parameter) => {
|
|
154
|
+
const ref = parameter.type;
|
|
155
|
+
if (ref === undefined)
|
|
156
|
+
return false;
|
|
157
|
+
if (ref.kind === "callback")
|
|
158
|
+
return true;
|
|
159
|
+
if (ref.kind !== "named")
|
|
160
|
+
return false;
|
|
161
|
+
const namespaceName = ref.namespaceName ?? context.namespace.name;
|
|
162
|
+
const resolved = context.repository.resolveNamed(namespaceName, ref.typeName);
|
|
163
|
+
return resolved !== undefined && resolved.kind === "callback";
|
|
164
|
+
};
|
|
165
|
+
export const renderMethodBody = (context, fn, options) => {
|
|
166
|
+
const { bindingExpression, isStatic, returnAs } = options;
|
|
167
|
+
const builder = { callArgs: [], setup: [], outRefs: [] };
|
|
168
|
+
if (!isStatic && fn.instance !== undefined) {
|
|
169
|
+
context.addRuntimeImport("getHandle");
|
|
170
|
+
builder.callArgs.push("getHandle(this)");
|
|
171
|
+
}
|
|
172
|
+
collectParameterArgs(context, fn, builder);
|
|
173
|
+
const errorRef = appendErrorRef(fn, builder);
|
|
174
|
+
const callExpression = `${bindingExpression}(${builder.callArgs.join(", ")})`;
|
|
175
|
+
const lines = [...builder.setup];
|
|
176
|
+
const returnsValue = !isVoidReturn(fn);
|
|
177
|
+
lines.push(returnsValue ? `const __result = ${callExpression};` : `${callExpression};`);
|
|
178
|
+
if (errorRef !== undefined) {
|
|
179
|
+
context.addRuntimeImport("checkError");
|
|
180
|
+
lines.push(`checkError(${errorRef}, ${context.qualify("GLib", "Error")});`);
|
|
181
|
+
}
|
|
182
|
+
const primary = returnsValue ? wrapPrimary(context, fn, "__result", returnAs) : undefined;
|
|
183
|
+
appendReturn(context, lines, primary, builder.outRefs);
|
|
184
|
+
return lines.join("\n");
|
|
185
|
+
};
|
|
186
|
+
const collectParameterArgs = (context, fn, builder) => {
|
|
187
|
+
const lengthFor = arrayLengthSources(fn);
|
|
188
|
+
const closureIndices = closureAndDestroyIndices(fn);
|
|
189
|
+
const returnLengthIndices = returnArrayLengthIndices(fn);
|
|
190
|
+
fn.parameters.forEach((parameter, index) => {
|
|
191
|
+
if (parameter.isVarargs)
|
|
192
|
+
return;
|
|
193
|
+
if (isOutParameter(parameter)) {
|
|
194
|
+
appendOutRef({ context, parameter, index, returnLengthIndices, builder });
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (isCallerAllocatedOut(parameter)) {
|
|
198
|
+
appendCallerAllocatedOut(context, parameter, builder);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (isInoutParameter(parameter)) {
|
|
202
|
+
appendInoutParameter({ context, parameter, index, returnLengthIndices, builder });
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const sourceIndex = lengthFor.get(index);
|
|
206
|
+
if (sourceIndex !== undefined) {
|
|
207
|
+
const source = fn.parameters[sourceIndex];
|
|
208
|
+
if (source !== undefined) {
|
|
209
|
+
builder.callArgs.push(`${parameterIdentifier(source, sourceIndex)}.length`);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (closureIndices.has(index)) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
builder.callArgs.push(parameterCallExpression(context, parameter, index));
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
const appendOutRef = (options) => {
|
|
220
|
+
const { context, parameter, builder } = options;
|
|
221
|
+
const refName = `out${builder.outRefs.length}`;
|
|
222
|
+
builder.setup.push(`const ${refName}: { value: unknown } = { value: ${outRefInitial(context, parameter.type)} };`);
|
|
223
|
+
registerRefArg(options, refName);
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* The initial value seeded into a pure-out `{ value }` ref cell.
|
|
227
|
+
*
|
|
228
|
+
* The native marshaller encodes the cell's current value against the ref's
|
|
229
|
+
* inner FFI type before the call, so the seed must be assignable to that
|
|
230
|
+
* type: numeric and pointer cells seed `0`, booleans `false`, strings `""`,
|
|
231
|
+
* and object/boxed cells `null`.
|
|
232
|
+
*/
|
|
233
|
+
const outRefInitial = (context, ref) => {
|
|
234
|
+
if (ref === undefined)
|
|
235
|
+
return "null";
|
|
236
|
+
switch (ref.kind) {
|
|
237
|
+
case "primitive":
|
|
238
|
+
return primitiveInitial(ref.category);
|
|
239
|
+
case "named":
|
|
240
|
+
return namedInitial(context, ref);
|
|
241
|
+
case "array":
|
|
242
|
+
case "list":
|
|
243
|
+
case "hashtable":
|
|
244
|
+
case "callback":
|
|
245
|
+
case "varargs":
|
|
246
|
+
return "null";
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
const primitiveInitial = (category) => {
|
|
250
|
+
switch (category) {
|
|
251
|
+
case "boolean":
|
|
252
|
+
return "false";
|
|
253
|
+
case "string":
|
|
254
|
+
return '""';
|
|
255
|
+
case "void":
|
|
256
|
+
return "null";
|
|
257
|
+
default:
|
|
258
|
+
return "0";
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
const namedInitial = (context, ref) => {
|
|
262
|
+
const owner = ref.namespaceName ?? context.namespace.name;
|
|
263
|
+
const resolved = context.repository.resolveNamed(owner, ref.typeName);
|
|
264
|
+
if (resolved === undefined)
|
|
265
|
+
return "null";
|
|
266
|
+
if (resolved.kind === "enum")
|
|
267
|
+
return "0";
|
|
268
|
+
if (resolved.kind === "alias") {
|
|
269
|
+
const qualified = qualifyTypeRef(resolved.targetRef, resolved.namespace.name);
|
|
270
|
+
return qualified === undefined ? "null" : outRefInitial(context, qualified);
|
|
271
|
+
}
|
|
272
|
+
return "null";
|
|
273
|
+
};
|
|
274
|
+
const appendInoutRef = (options) => {
|
|
275
|
+
const { context, parameter, index, builder } = options;
|
|
276
|
+
const refName = `inout${builder.outRefs.length}`;
|
|
277
|
+
builder.setup.push(`const ${refName}: { value: unknown } = { value: ${parameterCallExpression(context, parameter, index)} };`);
|
|
278
|
+
registerRefArg(options, refName);
|
|
279
|
+
};
|
|
280
|
+
const appendInoutParameter = (options) => {
|
|
281
|
+
const { context, parameter } = options;
|
|
282
|
+
if (parameter.type !== undefined && isHandlePassing(context, parameter.type)) {
|
|
283
|
+
appendInoutHandle(options);
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
appendInoutRef(options);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
const appendInoutHandle = (options) => {
|
|
290
|
+
const { context, parameter, index, returnLengthIndices, builder } = options;
|
|
291
|
+
builder.callArgs.push(parameterCallExpression(context, parameter, index));
|
|
292
|
+
if (!returnLengthIndices.has(index)) {
|
|
293
|
+
builder.outRefs.push({
|
|
294
|
+
name: parameterIdentifier(parameter, index),
|
|
295
|
+
type: parameter.type,
|
|
296
|
+
nullable: parameter.nullable,
|
|
297
|
+
raw: true,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
const registerRefArg = (options, refName) => {
|
|
302
|
+
const { parameter, index, returnLengthIndices, builder } = options;
|
|
303
|
+
builder.callArgs.push(refName);
|
|
304
|
+
if (!returnLengthIndices.has(index)) {
|
|
305
|
+
builder.outRefs.push({ name: refName, type: parameter.type, nullable: parameter.nullable });
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
const appendCallerAllocatedOut = (context, parameter, builder) => {
|
|
309
|
+
const allocated = allocateCallerOut(context, parameter, builder.outRefs.length);
|
|
310
|
+
if (allocated === undefined) {
|
|
311
|
+
builder.callArgs.push("undefined");
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
builder.setup.push(allocated.setup);
|
|
315
|
+
builder.callArgs.push(allocated.callArg);
|
|
316
|
+
builder.outRefs.push({
|
|
317
|
+
name: allocated.returnExpression,
|
|
318
|
+
type: parameter.type,
|
|
319
|
+
nullable: parameter.nullable,
|
|
320
|
+
raw: true,
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
const appendErrorRef = (fn, builder) => {
|
|
324
|
+
if (!fn.throws)
|
|
325
|
+
return undefined;
|
|
326
|
+
const errorRef = "__error";
|
|
327
|
+
builder.setup.push(`const ${errorRef} = { value: null };`);
|
|
328
|
+
builder.callArgs.push(errorRef);
|
|
329
|
+
return errorRef;
|
|
330
|
+
};
|
|
331
|
+
const appendReturn = (context, lines, primary, outRefs) => {
|
|
332
|
+
if (outRefs.length === 0) {
|
|
333
|
+
if (primary !== undefined)
|
|
334
|
+
lines.push(`return ${primary};`);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
const outExpressions = outRefs.map((ref) => ref.raw === true
|
|
338
|
+
? ref.name
|
|
339
|
+
: wrapReturnValue(context, {
|
|
340
|
+
ref: ref.type,
|
|
341
|
+
transfer: "full",
|
|
342
|
+
nullable: false,
|
|
343
|
+
valueExpression: `${ref.name}.value`,
|
|
344
|
+
}));
|
|
345
|
+
if (primary !== undefined) {
|
|
346
|
+
lines.push(`return [${primary}, ${outExpressions.join(", ")}];`);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
if (outExpressions.length === 1) {
|
|
350
|
+
lines.push(`return ${outExpressions[0]};`);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
lines.push(`return [${outExpressions.join(", ")}];`);
|
|
354
|
+
};
|
|
355
|
+
const allocateCallerOut = (context, parameter, index) => {
|
|
356
|
+
if (parameter.type === undefined || parameter.type.kind !== "named")
|
|
357
|
+
return undefined;
|
|
358
|
+
if (!isCollectibleCallerOut(context, parameter))
|
|
359
|
+
return undefined;
|
|
360
|
+
const owner = parameter.type.namespaceName ?? context.namespace.name;
|
|
361
|
+
const local = `__out${index}`;
|
|
362
|
+
const classExpression = context.qualify(owner, parameter.type.typeName);
|
|
363
|
+
context.addRuntimeImport("getHandle");
|
|
364
|
+
return {
|
|
365
|
+
setup: `const ${local} = new ${classExpression}();`,
|
|
366
|
+
callArg: `getHandle(${local})`,
|
|
367
|
+
returnExpression: local,
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
const parameterCallExpression = (context, parameter, index) => {
|
|
371
|
+
const name = parameterIdentifier(parameter, index);
|
|
372
|
+
const ref = parameter.type;
|
|
373
|
+
if (ref === undefined)
|
|
374
|
+
return name;
|
|
375
|
+
const callback = resolveCallbackType(context, ref);
|
|
376
|
+
if (callback !== undefined)
|
|
377
|
+
return renderCallbackArgument(context, callback, name);
|
|
378
|
+
const nullable = parameter.nullable || parameter.optional;
|
|
379
|
+
if (isHandlePassing(context, ref)) {
|
|
380
|
+
if (nullable) {
|
|
381
|
+
context.addRuntimeImport("tryGetHandle");
|
|
382
|
+
return `tryGetHandle(${name})`;
|
|
383
|
+
}
|
|
384
|
+
context.addRuntimeImport("getHandle");
|
|
385
|
+
return `getHandle(${name})`;
|
|
386
|
+
}
|
|
387
|
+
if ((ref.kind === "array" || ref.kind === "list") && isHandlePassing(context, ref.element)) {
|
|
388
|
+
context.addRuntimeImport("getHandle");
|
|
389
|
+
return nullable ? `${name}?.map((item) => getHandle(item))` : `${name}.map((item) => getHandle(item))`;
|
|
390
|
+
}
|
|
391
|
+
if (ref.kind === "hashtable") {
|
|
392
|
+
if (isHandlePassing(context, ref.value)) {
|
|
393
|
+
context.addRuntimeImport("tryGetHandle");
|
|
394
|
+
return `${name} ? globalThis.Array.from(${name}).map(([k, v]) => [k, tryGetHandle(v)]) : null`;
|
|
395
|
+
}
|
|
396
|
+
return `${name} ? globalThis.Array.from(${name}) : null`;
|
|
397
|
+
}
|
|
398
|
+
return name;
|
|
399
|
+
};
|
|
400
|
+
/**
|
|
401
|
+
* Plans how a callback or signal trampoline forwards its raw arguments to the
|
|
402
|
+
* user handler.
|
|
403
|
+
*
|
|
404
|
+
* In-parameters are wrapped via {@link wrapReturnValue} and joined into the
|
|
405
|
+
* handler call; out-parameters are dropped from the call and their trampoline
|
|
406
|
+
* cell indices collected for write-back. `argOffset` shifts every `args[...]`
|
|
407
|
+
* access: callbacks read from index `0`, while signal trampolines reserve
|
|
408
|
+
* index `0` for the emitting instance and so pass `1`.
|
|
409
|
+
*
|
|
410
|
+
* @param context - The module context
|
|
411
|
+
* @param parameters - The callback or signal parameters, varargs excluded
|
|
412
|
+
* @param namespaceName - The namespace the parameter type references resolve against
|
|
413
|
+
* @param argOffset - Added to each parameter's positional index
|
|
414
|
+
*/
|
|
415
|
+
export const planTrampolineArgs = (context, parameters, namespaceName, argOffset) => {
|
|
416
|
+
const callArgs = parameters
|
|
417
|
+
.map((parameter, index) => isOutParameter(parameter)
|
|
418
|
+
? undefined
|
|
419
|
+
: wrapReturnValue(context, {
|
|
420
|
+
ref: qualifyTypeRef(parameter.type, namespaceName),
|
|
421
|
+
transfer: parameter.transferOwnership,
|
|
422
|
+
nullable: parameter.nullable,
|
|
423
|
+
valueExpression: isCellInout(context, parameter)
|
|
424
|
+
? `args[${index + argOffset}].value`
|
|
425
|
+
: `args[${index + argOffset}]`,
|
|
426
|
+
}))
|
|
427
|
+
.filter((expression) => expression !== undefined)
|
|
428
|
+
.join(", ");
|
|
429
|
+
const outArgIndices = parameters
|
|
430
|
+
.map((parameter, index) => isOutParameter(parameter) || isCellInout(context, parameter) ? index + argOffset : -1)
|
|
431
|
+
.filter((index) => index >= 0);
|
|
432
|
+
return { callArgs, outArgIndices };
|
|
433
|
+
};
|
|
434
|
+
const renderCallbackArgument = (context, resolved, name) => {
|
|
435
|
+
const { callback, namespaceName } = resolved;
|
|
436
|
+
const { callArgs, outArgIndices } = planTrampolineArgs(context, callback.parameters, namespaceName, 0);
|
|
437
|
+
const returnRef = qualifyTypeRef(callback.returnValue.type, namespaceName);
|
|
438
|
+
if (outArgIndices.length > 0) {
|
|
439
|
+
const body = renderTupleWriteback(context, `${name}(${callArgs})`, outArgIndices, returnRef);
|
|
440
|
+
return `${name} ? (...args: unknown[]) => {\n ${body}\n} : null`;
|
|
441
|
+
}
|
|
442
|
+
if (returnRef !== undefined && isHandlePassing(context, returnRef)) {
|
|
443
|
+
context.addRuntimeImport("getHandle");
|
|
444
|
+
return `${name} ? (...args: unknown[]) => {\n const _result = ${name}(${callArgs});\n return _result != null ? getHandle(_result) : null;\n} : null`;
|
|
445
|
+
}
|
|
446
|
+
return `${name} ? (...args: unknown[]) => ${name}(${callArgs}) : null`;
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* Renders the body of a native→JS callback wrapper that returns out-parameters
|
|
450
|
+
* as a tuple.
|
|
451
|
+
*
|
|
452
|
+
* The wrapped user function returns `[primary, ...outs]` (or the scalar out
|
|
453
|
+
* alone for a void return with a single out, or an out-only tuple otherwise).
|
|
454
|
+
* This emits `const _result = …;`, writes each out value into its `{ value }`
|
|
455
|
+
* cell's `value` slot (`args[i].value = …`), and returns the primary — keeping the
|
|
456
|
+
* tuple convention entirely in generated code so the native layer only flushes
|
|
457
|
+
* cells through their out-pointers. Shared by signal and callback writers.
|
|
458
|
+
*
|
|
459
|
+
* @param context - The module context
|
|
460
|
+
* @param callExpression - The expression that invokes the user function
|
|
461
|
+
* @param outArgIndices - Argument indices of the out-parameter cells
|
|
462
|
+
* @param returnRef - The primary return type, or `undefined` for void
|
|
463
|
+
*/
|
|
464
|
+
export const renderTupleWriteback = (context, callExpression, outArgIndices, returnRef) => {
|
|
465
|
+
const lines = [`const _result = ${callExpression};`];
|
|
466
|
+
const isVoid = returnRef === undefined || (returnRef.kind === "primitive" && returnRef.category === "void");
|
|
467
|
+
if (!isVoid) {
|
|
468
|
+
outArgIndices.forEach((argIndex, position) => {
|
|
469
|
+
lines.push(`args[${argIndex}].value = _result[${position + 1}];`);
|
|
470
|
+
});
|
|
471
|
+
if (returnRef !== undefined && isHandlePassing(context, returnRef)) {
|
|
472
|
+
context.addRuntimeImport("tryGetHandle");
|
|
473
|
+
lines.push("return tryGetHandle(_result[0]);");
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
lines.push("return _result[0];");
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
else if (outArgIndices.length === 1) {
|
|
480
|
+
lines.push(`args[${outArgIndices[0]}].value = _result;`);
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
outArgIndices.forEach((argIndex, position) => {
|
|
484
|
+
lines.push(`args[${argIndex}].value = _result[${position}];`);
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
return lines.join("\n ");
|
|
488
|
+
};
|
|
489
|
+
const wrapPrimary = (context, fn, valueExpression, returnAs) => {
|
|
490
|
+
if (returnAs !== undefined) {
|
|
491
|
+
const handle = handleCast(context, valueExpression, false);
|
|
492
|
+
if (returnAs.via === "gobject") {
|
|
493
|
+
context.addRuntimeImport("getNativeObject");
|
|
494
|
+
return `getNativeObject(${handle})`;
|
|
495
|
+
}
|
|
496
|
+
if (returnAs.via === "boxed") {
|
|
497
|
+
context.addRuntimeImport("getNativeObject");
|
|
498
|
+
return `getNativeObject(${handle}, ${returnAs.className})`;
|
|
499
|
+
}
|
|
500
|
+
context.addRuntimeImport("getNativeObjectAsInterface");
|
|
501
|
+
return `getNativeObjectAsInterface(${handle}, ${returnAs.className})`;
|
|
502
|
+
}
|
|
503
|
+
return wrapReturnValue(context, {
|
|
504
|
+
ref: fn.returnValue.type,
|
|
505
|
+
transfer: fn.returnValue.transferOwnership,
|
|
506
|
+
nullable: fn.returnValue.nullable,
|
|
507
|
+
valueExpression,
|
|
508
|
+
});
|
|
509
|
+
};
|
|
510
|
+
//# sourceMappingURL=method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method.js","sourceRoot":"","sources":["../../src/writers/method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,C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Q,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;YAC3B,OAAO,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;YAC5C,OAAO,mBAAmB,MAAM,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC;QAC/D,CAAC;QACD,OAAO,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,CAAC;QACvD,OAAO,8BAA8B,MAAM,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC;IAC1E,CAAC;IACD,OAAO,eAAe,CAAC,OAAO,EAAE;QAC5B,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI;QACxB,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,iBAAiB;QAC1C,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ;QACjC,eAAe;KAClB,CAAC,CAAC;AACP,CAAC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { ModuleContext } from "../dsl/context.js";
|
|
2
|
+
import type { GirFunction } from "../gir/function.js";
|
|
3
|
+
import { type GirParameter } from "../gir/parameter.js";
|
|
4
|
+
import type { GirTypeRef } from "../gir/type-ref.js";
|
|
5
|
+
/**
|
|
6
|
+
* Parameter classification shared across the callable writers: which positions
|
|
7
|
+
* a TypeScript signature exposes, which marshal through a `{ value }` ref cell,
|
|
8
|
+
* which cross the FFI as native handles, and how a parameter is named. Depends
|
|
9
|
+
* only on the GIR model and the module context.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* A callable input parameter paired with its original GIR position.
|
|
13
|
+
*/
|
|
14
|
+
export type InputParameter = {
|
|
15
|
+
/** The GIR parameter. */
|
|
16
|
+
readonly parameter: GirParameter;
|
|
17
|
+
/** The parameter's index in the callable's full parameter list. */
|
|
18
|
+
readonly index: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The input parameters a callable's TypeScript signature exposes.
|
|
22
|
+
*
|
|
23
|
+
* Drops `<varargs>` slots, out-only and caller-allocated-out parameters,
|
|
24
|
+
* array-length parameters computed from a sibling array, and the
|
|
25
|
+
* `user_data`/`GDestroyNotify` slots folded into a callback descriptor. Each
|
|
26
|
+
* surviving parameter keeps its original index so callers can recover argument
|
|
27
|
+
* names.
|
|
28
|
+
*
|
|
29
|
+
* @param fn - The callable
|
|
30
|
+
*/
|
|
31
|
+
export declare const inputParameters: (fn: GirFunction) => readonly InputParameter[];
|
|
32
|
+
/**
|
|
33
|
+
* Indices of the `gpointer user_data` and `GDestroyNotify` parameters paired
|
|
34
|
+
* to a callback parameter. These slots are folded into the callback's
|
|
35
|
+
* trampoline descriptor and are not emitted as standalone FFI arguments.
|
|
36
|
+
*
|
|
37
|
+
* @param fn - The callable
|
|
38
|
+
*/
|
|
39
|
+
export declare const closureAndDestroyIndices: (fn: GirFunction) => ReadonlySet<number>;
|
|
40
|
+
/**
|
|
41
|
+
* Maps each array-length parameter's index to the array parameter whose
|
|
42
|
+
* `.length` supplies it.
|
|
43
|
+
*
|
|
44
|
+
* @param fn - The callable
|
|
45
|
+
*/
|
|
46
|
+
export declare const arrayLengthSources: (fn: GirFunction) => ReadonlyMap<number, number>;
|
|
47
|
+
/**
|
|
48
|
+
* Indices of parameters consumed as the length of the return array (and so
|
|
49
|
+
* dropped from the return tuple).
|
|
50
|
+
*
|
|
51
|
+
* @param fn - The callable
|
|
52
|
+
*/
|
|
53
|
+
export declare const returnArrayLengthIndices: (fn: GirFunction) => ReadonlySet<number>;
|
|
54
|
+
/**
|
|
55
|
+
* Whether a parameter is passed to the FFI binding as a `t.ref(...)` cell.
|
|
56
|
+
*
|
|
57
|
+
* Pure out parameters marshal through a `{ value }` ref cell the native layer
|
|
58
|
+
* writes into. Inout parameters do too — except handle-passing ones
|
|
59
|
+
* (objects, interfaces, boxed), which are passed by their existing handle
|
|
60
|
+
* and mutated in place, not through a pointer-to-pointer cell.
|
|
61
|
+
* Caller-allocated outs pass a pre-built handle and are excluded.
|
|
62
|
+
*
|
|
63
|
+
* @param context - The module context
|
|
64
|
+
* @param parameter - The parameter to test
|
|
65
|
+
*/
|
|
66
|
+
export declare const needsRefArg: (context: ModuleContext, parameter: GirParameter) => boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether a caller-allocated-out parameter is one the body can materialize and
|
|
69
|
+
* collect into the return — a boxed record or class the runtime can allocate
|
|
70
|
+
* via its wrapper constructor. Array and other caller-out buffers cannot be
|
|
71
|
+
* allocated here, so they are excluded from both the body and the return type.
|
|
72
|
+
*
|
|
73
|
+
* @param context - The module context
|
|
74
|
+
* @param parameter - The parameter to test
|
|
75
|
+
*/
|
|
76
|
+
export declare const isCollectibleCallerOut: (context: ModuleContext, parameter: GirParameter) => boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether a value of `ref` is passed across the FFI boundary as a native
|
|
79
|
+
* handle (object, interface, boxed, or an alias to one) instead of by value.
|
|
80
|
+
*
|
|
81
|
+
* @param context - The module context
|
|
82
|
+
* @param ref - The type reference to test
|
|
83
|
+
*/
|
|
84
|
+
export declare const isHandlePassing: (context: ModuleContext, ref: GirTypeRef) => boolean;
|
|
85
|
+
/**
|
|
86
|
+
* The JavaScript identifier for a parameter: the camelCased GIR name, or
|
|
87
|
+
* `arg<index>` for an unnamed position.
|
|
88
|
+
*
|
|
89
|
+
* @param parameter - The GIR parameter
|
|
90
|
+
* @param index - The parameter's position in the callable
|
|
91
|
+
*/
|
|
92
|
+
export declare const parameterIdentifier: (parameter: GirParameter, index: number) => string;
|
|
93
|
+
//# sourceMappingURL=param-classify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"param-classify.d.ts","sourceRoot":"","sources":["../../src/writers/param-classify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,KAAK,YAAY,EAAwC,MAAM,qBAAqB,CAAC;AA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