@gtkx/codegen 1.0.0-rc.4 → 1.1.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/README.md +5 -5
- package/dist/analysis/descriptor-render.d.ts +13 -9
- package/dist/analysis/descriptor-render.d.ts.map +1 -1
- package/dist/analysis/descriptor-render.js +80 -50
- package/dist/analysis/descriptor-render.js.map +1 -1
- package/dist/analysis/descriptor.d.ts +16 -7
- package/dist/analysis/descriptor.d.ts.map +1 -1
- package/dist/analysis/descriptor.js +15 -3
- package/dist/analysis/descriptor.js.map +1 -1
- package/dist/analysis/inheritance.d.ts +4 -3
- package/dist/analysis/inheritance.d.ts.map +1 -1
- package/dist/analysis/inheritance.js +103 -58
- package/dist/analysis/inheritance.js.map +1 -1
- package/dist/analysis/interface-conflicts.d.ts +23 -0
- package/dist/analysis/interface-conflicts.d.ts.map +1 -0
- package/dist/analysis/interface-conflicts.js +144 -0
- package/dist/analysis/interface-conflicts.js.map +1 -0
- package/dist/analysis/nul-terminated-bytes.d.ts +5 -0
- package/dist/analysis/nul-terminated-bytes.d.ts.map +1 -0
- package/dist/analysis/nul-terminated-bytes.js +18 -0
- package/dist/analysis/nul-terminated-bytes.js.map +1 -0
- package/dist/analysis/param-capability.d.ts +5 -0
- package/dist/analysis/param-capability.d.ts.map +1 -0
- package/dist/analysis/param-capability.js +129 -0
- package/dist/analysis/param-capability.js.map +1 -0
- package/dist/analysis/param-structure.d.ts +11 -4
- package/dist/analysis/param-structure.d.ts.map +1 -1
- package/dist/analysis/param-structure.js +42 -16
- package/dist/analysis/param-structure.js.map +1 -1
- package/dist/analysis/ts-type.d.ts.map +1 -1
- package/dist/analysis/ts-type.js +10 -17
- package/dist/analysis/ts-type.js.map +1 -1
- package/dist/analysis/type-key.d.ts +5 -0
- package/dist/analysis/type-key.d.ts.map +1 -0
- package/dist/analysis/type-key.js +9 -0
- package/dist/analysis/type-key.js.map +1 -0
- package/dist/analysis/type-shape.d.ts +8 -0
- package/dist/analysis/type-shape.d.ts.map +1 -0
- package/dist/analysis/type-shape.js +12 -0
- package/dist/analysis/type-shape.js.map +1 -0
- package/dist/compile.d.ts +12 -3
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +73 -24
- package/dist/compile.js.map +1 -1
- package/dist/docs/api-reference.d.ts +2 -2
- package/dist/docs/api-reference.d.ts.map +1 -1
- package/dist/docs/api-reference.js +17 -23
- package/dist/docs/api-reference.js.map +1 -1
- package/dist/docs/element-page.d.ts +4 -4
- package/dist/docs/element-page.d.ts.map +1 -1
- package/dist/docs/element-page.js +36 -22
- package/dist/docs/element-page.js.map +1 -1
- package/dist/docs/handwritten-props.d.ts +9 -0
- package/dist/docs/handwritten-props.d.ts.map +1 -0
- package/dist/docs/handwritten-props.js +149 -0
- package/dist/docs/handwritten-props.js.map +1 -0
- package/dist/docs/pipeline.d.ts.map +1 -1
- package/dist/docs/pipeline.js +87 -20
- package/dist/docs/pipeline.js.map +1 -1
- package/dist/docs/render.d.ts +26 -5
- package/dist/docs/render.d.ts.map +1 -1
- package/dist/docs/render.js +88 -25
- package/dist/docs/render.js.map +1 -1
- package/dist/docs/symbol-page.d.ts +17 -0
- package/dist/docs/symbol-page.d.ts.map +1 -1
- package/dist/docs/symbol-page.js +132 -44
- package/dist/docs/symbol-page.js.map +1 -1
- package/dist/fingerprint.d.ts +12 -1
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +44 -28
- package/dist/fingerprint.js.map +1 -1
- package/dist/gi.d.ts.map +1 -1
- package/dist/gi.js +1 -0
- package/dist/gi.js.map +1 -1
- package/dist/gir/ancestry.d.ts +8 -2
- package/dist/gir/ancestry.d.ts.map +1 -1
- package/dist/gir/ancestry.js +19 -1
- package/dist/gir/ancestry.js.map +1 -1
- package/dist/gir/annotations.d.ts +21 -0
- package/dist/gir/annotations.d.ts.map +1 -0
- package/dist/gir/annotations.js +15 -0
- package/dist/gir/annotations.js.map +1 -0
- package/dist/gir/callback.d.ts +1 -0
- package/dist/gir/callback.d.ts.map +1 -1
- package/dist/gir/callback.js +1 -0
- package/dist/gir/callback.js.map +1 -1
- package/dist/gir/class.d.ts +32 -1
- package/dist/gir/class.d.ts.map +1 -1
- package/dist/gir/class.js +8 -3
- package/dist/gir/class.js.map +1 -1
- package/dist/gir/cursor-overrides.d.ts +8 -0
- package/dist/gir/cursor-overrides.d.ts.map +1 -0
- package/dist/gir/cursor-overrides.js +6 -0
- package/dist/gir/cursor-overrides.js.map +1 -0
- package/dist/gir/emittable.d.ts +7 -0
- package/dist/gir/emittable.d.ts.map +1 -0
- package/dist/gir/emittable.js +3 -0
- package/dist/gir/emittable.js.map +1 -0
- package/dist/gir/enum.d.ts +21 -1
- package/dist/gir/enum.d.ts.map +1 -1
- package/dist/gir/enum.js +9 -9
- package/dist/gir/enum.js.map +1 -1
- package/dist/gir/field.d.ts +19 -3
- package/dist/gir/field.d.ts.map +1 -1
- package/dist/gir/field.js +7 -8
- package/dist/gir/field.js.map +1 -1
- package/dist/gir/function.d.ts +15 -0
- package/dist/gir/function.d.ts.map +1 -1
- package/dist/gir/function.js +28 -2
- package/dist/gir/function.js.map +1 -1
- package/dist/gir/libraries.d.ts +1 -3
- package/dist/gir/libraries.d.ts.map +1 -1
- package/dist/gir/libraries.js +0 -1
- package/dist/gir/libraries.js.map +1 -1
- package/dist/gir/library.d.ts +36 -0
- package/dist/gir/library.d.ts.map +1 -1
- package/dist/gir/library.js +35 -1
- package/dist/gir/library.js.map +1 -1
- package/dist/gir/namespace.d.ts +43 -1
- package/dist/gir/namespace.d.ts.map +1 -1
- package/dist/gir/namespace.js +8 -7
- package/dist/gir/namespace.js.map +1 -1
- package/dist/gir/parameter.d.ts +52 -1
- package/dist/gir/parameter.d.ts.map +1 -1
- package/dist/gir/parameter.js +8 -3
- package/dist/gir/parameter.js.map +1 -1
- package/dist/gir/parse.d.ts +3 -1
- package/dist/gir/parse.d.ts.map +1 -1
- package/dist/gir/parse.js +9 -9
- package/dist/gir/parse.js.map +1 -1
- package/dist/gir/primitives.d.ts +1 -0
- package/dist/gir/primitives.d.ts.map +1 -1
- package/dist/gir/primitives.js.map +1 -1
- package/dist/gir/property.d.ts +16 -0
- package/dist/gir/property.d.ts.map +1 -1
- package/dist/gir/property.js +3 -3
- package/dist/gir/property.js.map +1 -1
- package/dist/gir/record.d.ts +22 -0
- package/dist/gir/record.d.ts.map +1 -1
- package/dist/gir/record.js +3 -2
- package/dist/gir/record.js.map +1 -1
- package/dist/gir/size.d.ts +5 -4
- package/dist/gir/size.d.ts.map +1 -1
- package/dist/gir/size.js.map +1 -1
- package/dist/gir/type-id.d.ts +35 -0
- package/dist/gir/type-id.d.ts.map +1 -1
- package/dist/gir/type-id.js +1 -0
- package/dist/gir/type-id.js.map +1 -1
- package/dist/gir/type-ref.d.ts.map +1 -1
- package/dist/gir/type-ref.js +1 -0
- package/dist/gir/type-ref.js.map +1 -1
- package/dist/gir/type.d.ts +20 -0
- package/dist/gir/type.d.ts.map +1 -1
- package/dist/gir/type.js.map +1 -1
- package/dist/guards.d.ts +16 -0
- package/dist/guards.d.ts.map +1 -0
- package/dist/guards.js +11 -0
- package/dist/guards.js.map +1 -0
- package/dist/internal.d.ts +2 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -1
- package/dist/json.d.ts +3 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +11 -0
- package/dist/json.js.map +1 -0
- package/dist/khronos/args.d.ts +7 -6
- package/dist/khronos/args.d.ts.map +1 -1
- package/dist/khronos/args.js +28 -6
- package/dist/khronos/args.js.map +1 -1
- package/dist/khronos/doc-context.d.ts +29 -0
- package/dist/khronos/doc-context.d.ts.map +1 -0
- package/dist/khronos/doc-context.js +29 -0
- package/dist/khronos/doc-context.js.map +1 -0
- package/dist/khronos/extensions.d.ts +13 -0
- package/dist/khronos/extensions.d.ts.map +1 -0
- package/dist/khronos/extensions.js +49 -0
- package/dist/khronos/extensions.js.map +1 -0
- package/dist/khronos/jsdoc.d.ts +17 -11
- package/dist/khronos/jsdoc.d.ts.map +1 -1
- package/dist/khronos/jsdoc.js +104 -46
- package/dist/khronos/jsdoc.js.map +1 -1
- package/dist/khronos/model.d.ts +42 -3
- package/dist/khronos/model.d.ts.map +1 -1
- package/dist/khronos/model.js +218 -63
- package/dist/khronos/model.js.map +1 -1
- package/dist/khronos/modules.d.ts +9 -6
- package/dist/khronos/modules.d.ts.map +1 -1
- package/dist/khronos/modules.js +112 -27
- package/dist/khronos/modules.js.map +1 -1
- package/dist/khronos/notes.d.ts +19 -0
- package/dist/khronos/notes.d.ts.map +1 -0
- package/dist/khronos/notes.js +35 -0
- package/dist/khronos/notes.js.map +1 -0
- package/dist/khronos/param-pair.d.ts +1 -1
- package/dist/khronos/param-pair.d.ts.map +1 -1
- package/dist/khronos/param-pair.js.map +1 -1
- package/dist/khronos/parse.d.ts.map +1 -1
- package/dist/khronos/parse.js +3 -4
- package/dist/khronos/parse.js.map +1 -1
- package/dist/khronos/pipeline.d.ts +4 -2
- package/dist/khronos/pipeline.d.ts.map +1 -1
- package/dist/khronos/pipeline.js +58 -27
- package/dist/khronos/pipeline.js.map +1 -1
- package/dist/khronos/plan.d.ts +3 -9
- package/dist/khronos/plan.d.ts.map +1 -1
- package/dist/khronos/plan.js +3 -3
- package/dist/khronos/plan.js.map +1 -1
- package/dist/khronos/render.d.ts +8 -6
- package/dist/khronos/render.d.ts.map +1 -1
- package/dist/khronos/render.js +35 -26
- package/dist/khronos/render.js.map +1 -1
- package/dist/khronos/select.d.ts +21 -4
- package/dist/khronos/select.d.ts.map +1 -1
- package/dist/khronos/select.js +47 -34
- package/dist/khronos/select.js.map +1 -1
- package/dist/react/element-config.d.ts +2 -2
- package/dist/react/element-config.d.ts.map +1 -1
- package/dist/react/element-config.js.map +1 -1
- package/dist/runner.d.ts +6 -8
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +16 -0
- package/dist/runner.js.map +1 -1
- package/dist/staging.d.ts +5 -0
- package/dist/staging.d.ts.map +1 -0
- package/dist/staging.js +57 -0
- package/dist/staging.js.map +1 -0
- package/dist/store/compile-store.d.ts +1 -1
- package/dist/store/compile-store.d.ts.map +1 -1
- package/dist/store/compile-store.js +4 -2
- package/dist/store/compile-store.js.map +1 -1
- package/dist/store/gi/callable-doc.d.ts +11 -0
- package/dist/store/gi/callable-doc.d.ts.map +1 -0
- package/dist/store/gi/callable-doc.js +62 -0
- package/dist/store/gi/callable-doc.js.map +1 -0
- package/dist/store/gi/callables.d.ts +9 -2
- package/dist/store/gi/callables.d.ts.map +1 -1
- package/dist/store/gi/callables.js +35 -40
- package/dist/store/gi/callables.js.map +1 -1
- package/dist/store/gi/callback.d.ts.map +1 -1
- package/dist/store/gi/callback.js +10 -6
- package/dist/store/gi/callback.js.map +1 -1
- package/dist/store/gi/class.d.ts.map +1 -1
- package/dist/store/gi/class.js +63 -40
- package/dist/store/gi/class.js.map +1 -1
- package/dist/store/gi/closure-invocation.d.ts +4 -0
- package/dist/store/gi/closure-invocation.d.ts.map +1 -0
- package/dist/store/gi/closure-invocation.js +22 -0
- package/dist/store/gi/closure-invocation.js.map +1 -0
- package/dist/store/gi/companion.d.ts.map +1 -1
- package/dist/store/gi/companion.js +6 -6
- package/dist/store/gi/companion.js.map +1 -1
- package/dist/store/gi/constant.d.ts.map +1 -1
- package/dist/store/gi/constant.js +12 -3
- package/dist/store/gi/constant.js.map +1 -1
- package/dist/store/gi/constructor-props.d.ts.map +1 -1
- package/dist/store/gi/constructor-props.js +18 -20
- package/dist/store/gi/constructor-props.js.map +1 -1
- package/dist/store/gi/doc-spec.d.ts +14 -0
- package/dist/store/gi/doc-spec.d.ts.map +1 -0
- package/dist/store/gi/doc-spec.js +23 -0
- package/dist/store/gi/doc-spec.js.map +1 -0
- package/dist/store/gi/enum.d.ts.map +1 -1
- package/dist/store/gi/enum.js +52 -19
- package/dist/store/gi/enum.js.map +1 -1
- package/dist/store/gi/function.d.ts +1 -3
- package/dist/store/gi/function.d.ts.map +1 -1
- package/dist/store/gi/function.js +50 -29
- package/dist/store/gi/function.js.map +1 -1
- package/dist/store/gi/gtype-binding.d.ts.map +1 -1
- package/dist/store/gi/gtype-binding.js +4 -1
- package/dist/store/gi/gtype-binding.js.map +1 -1
- package/dist/store/gi/interface.d.ts.map +1 -1
- package/dist/store/gi/interface.js +155 -26
- package/dist/store/gi/interface.js.map +1 -1
- package/dist/store/gi/item-comparators.d.ts.map +1 -1
- package/dist/store/gi/item-comparators.js +3 -5
- package/dist/store/gi/item-comparators.js.map +1 -1
- package/dist/store/gi/method.d.ts +11 -2
- package/dist/store/gi/method.d.ts.map +1 -1
- package/dist/store/gi/method.js +80 -45
- package/dist/store/gi/method.js.map +1 -1
- package/dist/store/gi/param-marshal.d.ts +6 -2
- package/dist/store/gi/param-marshal.d.ts.map +1 -1
- package/dist/store/gi/param-marshal.js +54 -5
- package/dist/store/gi/param-marshal.js.map +1 -1
- package/dist/store/gi/pipeline.d.ts.map +1 -1
- package/dist/store/gi/pipeline.js +23 -11
- package/dist/store/gi/pipeline.js.map +1 -1
- package/dist/store/gi/properties.d.ts +2 -1
- package/dist/store/gi/properties.d.ts.map +1 -1
- package/dist/store/gi/properties.js +7 -4
- package/dist/store/gi/properties.js.map +1 -1
- package/dist/store/gi/property-accessor.d.ts +12 -5
- package/dist/store/gi/property-accessor.d.ts.map +1 -1
- package/dist/store/gi/property-accessor.js +98 -46
- package/dist/store/gi/property-accessor.js.map +1 -1
- package/dist/store/gi/record-constructor.d.ts +8 -1
- package/dist/store/gi/record-constructor.d.ts.map +1 -1
- package/dist/store/gi/record-constructor.js +34 -11
- package/dist/store/gi/record-constructor.js.map +1 -1
- package/dist/store/gi/record-field-accessor.d.ts +3 -1
- package/dist/store/gi/record-field-accessor.d.ts.map +1 -1
- package/dist/store/gi/record-field-accessor.js +8 -3
- package/dist/store/gi/record-field-accessor.js.map +1 -1
- package/dist/store/gi/record-layout.d.ts +6 -1
- package/dist/store/gi/record-layout.d.ts.map +1 -1
- package/dist/store/gi/record-layout.js +9 -2
- package/dist/store/gi/record-layout.js.map +1 -1
- package/dist/store/gi/record.d.ts.map +1 -1
- package/dist/store/gi/record.js +21 -9
- package/dist/store/gi/record.js.map +1 -1
- package/dist/store/gi/registration.d.ts +1 -1
- package/dist/store/gi/registration.js +4 -4
- package/dist/store/gi/registration.js.map +1 -1
- package/dist/store/gi/runtime-override.d.ts +2 -1
- package/dist/store/gi/runtime-override.d.ts.map +1 -1
- package/dist/store/gi/runtime-override.js +8 -5
- package/dist/store/gi/runtime-override.js.map +1 -1
- package/dist/store/gi/signal.d.ts +2 -1
- package/dist/store/gi/signal.d.ts.map +1 -1
- package/dist/store/gi/signal.js +42 -37
- package/dist/store/gi/signal.js.map +1 -1
- package/dist/store/gi/value-marshalable.d.ts +1 -2
- package/dist/store/gi/value-marshalable.d.ts.map +1 -1
- package/dist/store/gi/value-marshalable.js +3 -2
- package/dist/store/gi/value-marshalable.js.map +1 -1
- package/dist/store/gi/vtable.d.ts +19 -1
- package/dist/store/gi/vtable.d.ts.map +1 -1
- package/dist/store/gi/vtable.js +257 -51
- package/dist/store/gi/vtable.js.map +1 -1
- package/dist/store/gi-store.d.ts +1 -0
- package/dist/store/gi-store.d.ts.map +1 -1
- package/dist/store/gi-store.js +15 -20
- package/dist/store/gi-store.js.map +1 -1
- package/dist/store/jsx/element-components.d.ts +1 -1
- package/dist/store/jsx/element-components.d.ts.map +1 -1
- package/dist/store/jsx/element-components.js +6 -4
- package/dist/store/jsx/element-components.js.map +1 -1
- package/dist/store/jsx/element-prop-imports.d.ts +1 -3
- package/dist/store/jsx/element-prop-imports.d.ts.map +1 -1
- package/dist/store/jsx/element-prop-imports.js.map +1 -1
- package/dist/store/jsx/element-prop-types.d.ts +3 -0
- package/dist/store/jsx/element-prop-types.d.ts.map +1 -1
- package/dist/store/jsx/element-prop-types.js +7 -1
- package/dist/store/jsx/element-prop-types.js.map +1 -1
- package/dist/store/jsx/generated-elements.d.ts +2 -1
- package/dist/store/jsx/generated-elements.d.ts.map +1 -1
- package/dist/store/jsx/generated-elements.js +13 -7
- package/dist/store/jsx/generated-elements.js.map +1 -1
- package/dist/store/jsx/intrinsic-elements.d.ts +4 -0
- package/dist/store/jsx/intrinsic-elements.d.ts.map +1 -1
- package/dist/store/jsx/intrinsic-elements.js.map +1 -1
- package/dist/store/jsx/jsx.d.ts.map +1 -1
- package/dist/store/jsx/jsx.js +10 -9
- package/dist/store/jsx/jsx.js.map +1 -1
- package/dist/store/jsx/metadata.d.ts.map +1 -1
- package/dist/store/jsx/metadata.js +5 -3
- package/dist/store/jsx/metadata.js.map +1 -1
- package/dist/store/jsx/pipeline.d.ts +1 -1
- package/dist/store/jsx/pipeline.d.ts.map +1 -1
- package/dist/store/jsx/pipeline.js.map +1 -1
- package/dist/store/jsx/props.d.ts +1 -7
- package/dist/store/jsx/props.d.ts.map +1 -1
- package/dist/store/jsx/props.js +14 -6
- package/dist/store/jsx/props.js.map +1 -1
- package/dist/store/jsx-store.d.ts.map +1 -1
- package/dist/store/jsx-store.js +3 -3
- package/dist/store/jsx-store.js.map +1 -1
- package/dist/store/resolve-store.d.ts +14 -3
- package/dist/store/resolve-store.d.ts.map +1 -1
- package/dist/store/resolve-store.js +98 -15
- package/dist/store/resolve-store.js.map +1 -1
- package/dist/store/store-fs.d.ts +9 -6
- package/dist/store/store-fs.d.ts.map +1 -1
- package/dist/store/store-fs.js +59 -25
- package/dist/store/store-fs.js.map +1 -1
- package/dist/store/store-links.d.ts +3 -0
- package/dist/store/store-links.d.ts.map +1 -0
- package/dist/store/store-links.js +39 -0
- package/dist/store/store-links.js.map +1 -0
- package/dist/writer/comparison-context.d.ts +4 -0
- package/dist/writer/comparison-context.d.ts.map +1 -0
- package/dist/writer/comparison-context.js +13 -0
- package/dist/writer/comparison-context.js.map +1 -0
- package/dist/writer/context.d.ts +3 -2
- package/dist/writer/context.d.ts.map +1 -1
- package/dist/writer/context.js +11 -3
- package/dist/writer/context.js.map +1 -1
- package/dist/writer/doc-tags.d.ts +21 -0
- package/dist/writer/doc-tags.d.ts.map +1 -0
- package/dist/writer/doc-tags.js +38 -0
- package/dist/writer/doc-tags.js.map +1 -0
- package/dist/writer/doc.d.ts +3 -1
- package/dist/writer/doc.d.ts.map +1 -1
- package/dist/writer/doc.js +19 -6
- package/dist/writer/doc.js.map +1 -1
- package/dist/writer/gtk-doc.d.ts +1 -1
- package/dist/writer/gtk-doc.d.ts.map +1 -1
- package/dist/writer/gtk-doc.js +64 -15
- package/dist/writer/gtk-doc.js.map +1 -1
- package/dist/writer/module.d.ts +17 -3
- package/dist/writer/module.d.ts.map +1 -1
- package/dist/writer/module.js +72 -3
- package/dist/writer/module.js.map +1 -1
- package/dist/xml.d.ts +7 -1
- package/dist/xml.d.ts.map +1 -1
- package/dist/xml.js +43 -1
- package/dist/xml.js.map +1 -1
- package/overrides/gdk/rgba.ts.ejs +26 -0
- package/overrides/gobject/object.ts.ejs +48 -3
- package/overrides/gobject/value.ts.ejs +7 -0
- package/overrides/graphene/structs.ts.ejs +55 -0
- package/package.json +15 -4
- package/src/analysis/descriptor-render.ts +130 -66
- package/src/analysis/descriptor.ts +35 -11
- package/src/analysis/inheritance.ts +166 -75
- package/src/analysis/interface-conflicts.ts +237 -0
- package/src/analysis/nul-terminated-bytes.ts +31 -0
- package/src/analysis/param-capability.ts +169 -0
- package/src/analysis/param-structure.ts +85 -25
- package/src/analysis/ts-type.ts +13 -17
- package/src/analysis/type-key.ts +14 -0
- package/src/analysis/type-shape.ts +24 -0
- package/src/compile.ts +110 -26
- package/src/docs/api-reference.ts +46 -34
- package/src/docs/element-page.ts +58 -49
- package/src/docs/handwritten-props.ts +230 -0
- package/src/docs/pipeline.ts +131 -21
- package/src/docs/render.ts +153 -35
- package/src/docs/symbol-page.ts +230 -80
- package/src/fingerprint.ts +86 -32
- package/src/gi.ts +1 -0
- package/src/gir/ancestry.ts +31 -1
- package/src/gir/annotations.ts +37 -0
- package/src/gir/callback.ts +2 -0
- package/src/gir/class.ts +42 -4
- package/src/gir/cursor-overrides.ts +12 -0
- package/src/gir/emittable.ts +8 -0
- package/src/gir/enum.ts +30 -10
- package/src/gir/field.ts +24 -9
- package/src/gir/function.ts +60 -9
- package/src/gir/libraries.ts +11 -3
- package/src/gir/library.ts +52 -3
- package/src/gir/namespace.ts +49 -7
- package/src/gir/parameter.ts +62 -3
- package/src/gir/parse.ts +13 -9
- package/src/gir/primitives.ts +1 -0
- package/src/gir/property.ts +18 -3
- package/src/gir/record.ts +24 -2
- package/src/gir/size.ts +8 -3
- package/src/gir/type-id.ts +49 -3
- package/src/gir/type-ref.ts +1 -0
- package/src/gir/type.ts +50 -6
- package/src/guards.ts +23 -0
- package/src/internal.ts +2 -0
- package/src/json.ts +11 -0
- package/src/khronos/args.ts +36 -13
- package/src/khronos/doc-context.ts +62 -0
- package/src/khronos/extensions.ts +85 -0
- package/src/khronos/jsdoc.ts +152 -56
- package/src/khronos/model.ts +314 -69
- package/src/khronos/modules.ts +150 -40
- package/src/khronos/notes.ts +74 -0
- package/src/khronos/param-pair.ts +1 -1
- package/src/khronos/parse.ts +3 -4
- package/src/khronos/pipeline.ts +95 -42
- package/src/khronos/plan.ts +4 -6
- package/src/khronos/render.ts +62 -50
- package/src/khronos/select.ts +91 -50
- package/src/react/element-config.ts +2 -2
- package/src/runner.ts +20 -9
- package/src/staging.ts +69 -0
- package/src/store/compile-store.ts +7 -5
- package/src/store/gi/callable-doc.ts +102 -0
- package/src/store/gi/callables.ts +58 -44
- package/src/store/gi/callback.ts +10 -9
- package/src/store/gi/class.ts +83 -49
- package/src/store/gi/closure-invocation.ts +26 -0
- package/src/store/gi/companion.ts +7 -6
- package/src/store/gi/constant.ts +14 -5
- package/src/store/gi/constructor-props.ts +19 -23
- package/src/store/gi/doc-spec.ts +38 -0
- package/src/store/gi/enum.ts +75 -26
- package/src/store/gi/function.ts +72 -44
- package/src/store/gi/gtype-binding.ts +7 -2
- package/src/store/gi/interface.ts +244 -37
- package/src/store/gi/item-comparators.ts +3 -5
- package/src/store/gi/method.ts +124 -69
- package/src/store/gi/param-marshal.ts +91 -6
- package/src/store/gi/pipeline.ts +28 -13
- package/src/store/gi/properties.ts +10 -5
- package/src/store/gi/property-accessor.ts +163 -75
- package/src/store/gi/record-constructor.ts +56 -19
- package/src/store/gi/record-field-accessor.ts +13 -4
- package/src/store/gi/record-layout.ts +12 -2
- package/src/store/gi/record.ts +24 -10
- package/src/store/gi/registration.ts +5 -5
- package/src/store/gi/runtime-override.ts +13 -6
- package/src/store/gi/signal.ts +54 -57
- package/src/store/gi/value-marshalable.ts +4 -2
- package/src/store/gi/vtable.ts +439 -61
- package/src/store/gi-store.ts +26 -31
- package/src/store/jsx/element-components.ts +8 -5
- package/src/store/jsx/element-prop-imports.ts +1 -3
- package/src/store/jsx/element-prop-types.ts +10 -1
- package/src/store/jsx/generated-elements.ts +17 -8
- package/src/store/jsx/intrinsic-elements.ts +4 -0
- package/src/store/jsx/jsx.ts +11 -9
- package/src/store/jsx/metadata.ts +6 -3
- package/src/store/jsx/pipeline.ts +1 -1
- package/src/store/jsx/props.ts +20 -7
- package/src/store/jsx-store.ts +3 -3
- package/src/store/resolve-store.ts +133 -18
- package/src/store/store-fs.ts +87 -34
- package/src/store/store-links.ts +49 -0
- package/src/writer/comparison-context.ts +18 -0
- package/src/writer/context.ts +14 -4
- package/src/writer/doc-tags.ts +70 -0
- package/src/writer/doc.ts +29 -6
- package/src/writer/gtk-doc.ts +82 -15
- package/src/writer/module.ts +114 -4
- package/src/xml.ts +61 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-comparators.js","sourceRoot":"","sources":["../../../src/store/gi/item-comparators.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,M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E,CAAC","sourcesContent":["import type { GirFunction } from \"../../gir/function.js\";\nimport type { GirParameter } from \"../../gir/parameter.js\";\nimport type { TypeId } from \"../../gir/type-id.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport { tObject } from \"../../analysis/descriptor.js\";\nimport { inputParameters, parameterIdentifier } from \"../../analysis/param-structure.js\";\nimport { renderTsType } from \"../../analysis/ts-type.js\";\nimport { resolveInterfaces } from \"../../gir/ancestry.js\";\nimport { callbackAsFunction, type GirCallback } from \"../../gir/callback.js\";\n\nconst COMPARATOR_CALLBACK_TYPES = new Set([\n \"GLib.CompareFunc\",\n \"GLib.CompareDataFunc\",\n \"GLib.EqualFunc\",\n \"GLib.EqualFuncFull\",\n]);\n\nconst OBJECT_ITEM_COMPARATOR_OWNERS = new Set([\"Gtk.CustomSorter\"]);\n\nconst qualifiedName = (context: ModuleContext, ref: TypeId): string | undefined => {\n const name = context.library.nameFor(ref);\n\n return name === undefined ? undefined : `${name.namespaceName}.${name.typeName}`;\n};\n\nconst isListModelImplementor = (context: ModuleContext, ref: TypeId): boolean => {\n const resolved = context.library.typeFor(ref);\n\n if (resolved?.kind !== \"class\") {\n return false;\n }\n\n const interfaces = resolveInterfaces(context.library, resolved.namespace.name, resolved.value.implements);\n\n return interfaces.some((iface) => iface.namespaceName === \"Gio\" && iface.klass.name === \"ListModel\");\n};\n\nconst isObjectItemComparator = (context: ModuleContext, fn: GirFunction): boolean => {\n const ownerRef = fn.instance?.type ?? fn.returnValue.type;\n\n if (ownerRef === undefined) {\n return false;\n }\n\n const owner = qualifiedName(context, ownerRef);\n\n if (owner !== undefined && OBJECT_ITEM_COMPARATOR_OWNERS.has(owner)) {\n return true;\n }\n\n return isListModelImplementor(context, ownerRef);\n};\n\nconst isItemPointer = (context: ModuleContext, ref: TypeId | undefined): boolean => {\n if (ref === undefined) {\n return false;\n }\n\n const resolved = context.library.typeFor(ref);\n\n return resolved?.kind === \"primitive\" && resolved.category === \"pointer\";\n};\n\nconst itemComparatorCallback = (\n context: ModuleContext,\n fn: GirFunction,\n parameter: GirParameter,\n): GirCallback | undefined => {\n if (parameter.type === undefined) {\n return undefined;\n }\n\n const resolved = context.library.typeFor(parameter.type);\n\n if (resolved?.kind !== \"callback\") {\n return undefined;\n }\n\n const name = qualifiedName(context, parameter.type);\n\n if (name === undefined || !COMPARATOR_CALLBACK_TYPES.has(name)) {\n return undefined;\n }\n\n return isObjectItemComparator(context, fn) ? resolved.value : undefined;\n};\n\nconst itemComparatorArgDescriptors = (\n context: ModuleContext,\n fn: GirFunction,\n parameter: GirParameter,\n): Map<number, string> | undefined => {\n const callback = itemComparatorCallback(context, fn, parameter);\n\n if (callback === undefined) {\n return undefined;\n }\n\n const overrides: Map<number, string> = new Map();\n const items = inputParameters(context.library, callbackAsFunction(callback));\n\n for (const { parameter: item, index } of items) {\n if (isItemPointer(context, item.type)) {\n overrides.set(index, tObject(\"borrowed\"));\n }\n }\n\n return overrides.size > 0 ? overrides : undefined;\n};\n\nconst itemComparatorTsType = (\n context: ModuleContext,\n fn: GirFunction,\n parameter: GirParameter,\n): string | undefined => {\n const callback = itemComparatorCallback(context, fn, parameter);\n\n if (callback === undefined) {\n return undefined;\n }\n\n const itemType = `${context.qualify(\"GObject\", \"Object\")} | null`;\n\n const args = inputParameters(context.library, callbackAsFunction(callback)).map(({ parameter: item, index }) => {\n const tsType = isItemPointer(context, item.type) ? itemType : renderTsType(context, item.type, item.nullable);\n\n return `${parameterIdentifier(item, index)}: ${tsType}`;\n });\n\n const returnType = renderTsType(context, callback.returnValue.type, callback.returnValue.nullable);\n const fnType = `(${args.join(\", \")}) => ${returnType}`;\n\n return parameter.nullable ? `(${fnType}) | null` : fnType;\n};\n\nexport { itemComparatorArgDescriptors, itemComparatorTsType };\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { GirFunction } from "../../gir/function.js";
|
|
2
2
|
import type { ModuleContext } from "../../writer/context.js";
|
|
3
|
+
import { type InputParameter } from "../../analysis/param-structure.js";
|
|
4
|
+
import { type GirParameter } from "../../gir/parameter.js";
|
|
3
5
|
type WriteMethodBodyOptions = {
|
|
4
6
|
bindingExpression: string;
|
|
5
7
|
returnTypeOverride?: string | undefined;
|
|
@@ -8,8 +10,14 @@ type CallArgPlan = {
|
|
|
8
10
|
paramLiteral: string;
|
|
9
11
|
inputExpr: string | undefined;
|
|
10
12
|
};
|
|
13
|
+
type ReturnDescriptorPlan = {
|
|
14
|
+
descriptor: string;
|
|
15
|
+
isSkipped: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare const memberName: (girName: string) => string;
|
|
11
18
|
declare const methodExportName: (fn: GirFunction) => string;
|
|
12
19
|
declare const renderMethodSignature: (context: ModuleContext, fn: GirFunction) => string;
|
|
20
|
+
declare const returnedOutParameters: (context: ModuleContext, fn: GirFunction) => InputParameter[];
|
|
13
21
|
declare const renderMethodReturnType: (context: ModuleContext, fn: GirFunction) => string;
|
|
14
22
|
declare const renderPromisifiedBody: (context: ModuleContext, asyncFn: GirFunction, finishExpression: string, bindingExpression: string) => string;
|
|
15
23
|
declare const finishCallExpression: (asyncFn: GirFunction, finishFn: GirFunction, ownerName: string) => string;
|
|
@@ -17,8 +25,9 @@ declare const renderPromisifiedSignature: (context: ModuleContext, asyncFn: GirF
|
|
|
17
25
|
signature: string;
|
|
18
26
|
returnType: string;
|
|
19
27
|
};
|
|
28
|
+
declare const isCallbackParameter: (context: ModuleContext, parameter: GirParameter) => boolean;
|
|
20
29
|
declare const renderMethodBody: (context: ModuleContext, fn: GirFunction, options: WriteMethodBodyOptions) => string;
|
|
21
|
-
declare const renderReturnDescriptor: (context: ModuleContext, fn: GirFunction) =>
|
|
30
|
+
declare const renderReturnDescriptor: (context: ModuleContext, fn: GirFunction) => ReturnDescriptorPlan;
|
|
22
31
|
declare const planCallArgs: (context: ModuleContext, fn: GirFunction) => CallArgPlan[];
|
|
23
|
-
export { methodExportName, renderMethodSignature, renderMethodReturnType, renderPromisifiedBody, finishCallExpression, renderPromisifiedSignature, renderMethodBody, renderReturnDescriptor, planCallArgs, };
|
|
32
|
+
export { isCallbackParameter, memberName, methodExportName, renderMethodSignature, renderMethodReturnType, returnedOutParameters, renderPromisifiedBody, finishCallExpression, renderPromisifiedSignature, renderMethodBody, renderReturnDescriptor, planCallArgs, };
|
|
24
33
|
//# sourceMappingURL=method.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../src/store/gi/method.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA+
|
|
1
|
+
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../src/store/gi/method.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAQ7D,OAAO,EAMH,KAAK,cAAc,EAGtB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,KAAK,YAAY,EAA0D,MAAM,wBAAwB,CAAC;AA+BnH,KAAK,sBAAsB,GAAG;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF,KAAK,WAAW,GAAG;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,CAAC;AAEF,KAAK,oBAAoB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACtB,CAAC;AAsBF,QAAA,MAAM,UAAU,GAAI,SAAS,MAAM,KAAG,MAIrC,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAAI,IAAI,WAAW,KAAG,MAA6B,CAAC;AAQ1E,QAAA,MA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
|
import { camelCase, sourceStringLiteral } from "@gtkx/utils";
|
|
2
|
-
import { renderCallbackType, renderDescriptor, renderSelfDescriptor, shouldOmitPrimaryReturn, } from "../../analysis/descriptor-render.js";
|
|
2
|
+
import { isSkippedPrimaryReturn, renderCallbackType, renderDescriptor, renderSelfDescriptor, shouldOmitPrimaryReturn, } from "../../analysis/descriptor-render.js";
|
|
3
3
|
import { arrayLengthSources, closureAndDestroyIndices, emittedArgIndices, foldedLengthIndices, foldOutParamShape, inputParameters, parameterIdentifier, } from "../../analysis/param-structure.js";
|
|
4
4
|
import { renderTsType } from "../../analysis/ts-type.js";
|
|
5
5
|
import { isCallerAllocatedOut, isInoutParameter, isOutParameter } from "../../gir/parameter.js";
|
|
6
6
|
import { hasUnknownArrayLength } from "../../gir/type-id.js";
|
|
7
|
+
import { areClosuresInvoked } from "./closure-invocation.js";
|
|
7
8
|
import { itemComparatorArgDescriptors, itemComparatorTsType } from "./item-comparators.js";
|
|
8
|
-
import { isCollectibleCallerOut, isHandlePassedInPlace, isHandlePassing } from "./param-marshal.js";
|
|
9
|
-
const
|
|
9
|
+
import { isClosureType, isCollectibleCallerOut, isHandlePassedInPlace, isHandlePassing, renderCallerOutInstance, } from "./param-marshal.js";
|
|
10
|
+
const memberName = (girName) => {
|
|
11
|
+
const camel = camelCase(girName);
|
|
12
|
+
return /^\d/.test(camel) ? `_${camel}` : camel;
|
|
13
|
+
};
|
|
14
|
+
const methodExportName = (fn) => memberName(fn.name);
|
|
10
15
|
const arrayLengthArgument = (source, sourceIndex) => {
|
|
11
16
|
const identifier = parameterIdentifier(source, sourceIndex);
|
|
12
17
|
return source.nullable || source.optional ? `(${identifier}?.length ?? 0)` : `${identifier}.length`;
|
|
13
18
|
};
|
|
14
|
-
const renderMethodSignature = (context, fn) => renderInputParameters(context, fn,
|
|
15
|
-
|
|
19
|
+
const renderMethodSignature = (context, fn) => renderInputParameters(context, fn, {
|
|
20
|
+
shouldSkip: () => false,
|
|
21
|
+
isOptionalExtra: () => false,
|
|
22
|
+
});
|
|
23
|
+
const closureAnnotation = (context, base) => {
|
|
24
|
+
context.addRuntimeTypeImport("ClosureCallback");
|
|
25
|
+
return `${base} | ClosureCallback`;
|
|
26
|
+
};
|
|
27
|
+
const requiresClosureMarshal = (context, fn, ref) => isClosureType(context, ref) && areClosuresInvoked(fn);
|
|
28
|
+
const requiresClosureAnnotation = (context, fn, parameter) => parameter.type !== undefined && requiresClosureMarshal(context, fn, parameter.type);
|
|
29
|
+
const parameterAnnotation = (context, fn, parameter) => {
|
|
30
|
+
const comparator = itemComparatorTsType(context, fn, parameter);
|
|
31
|
+
if (comparator !== undefined) {
|
|
32
|
+
return comparator;
|
|
33
|
+
}
|
|
34
|
+
const base = renderTsType(context, parameter.type, parameter.nullable);
|
|
35
|
+
return requiresClosureAnnotation(context, fn, parameter) ? closureAnnotation(context, base) : base;
|
|
36
|
+
};
|
|
16
37
|
const isParameterOptional = (parameter, isOptionalExtra) => parameter.optional || isOptionalExtra(parameter);
|
|
17
38
|
const formatParameterPart = (name, annotation, isOptional) => isOptional ? `${name}?: ${annotation}` : `${name}: ${annotation}`;
|
|
18
|
-
const renderInputParameters = (context, fn,
|
|
39
|
+
const renderInputParameters = (context, fn, options) => {
|
|
19
40
|
const parts = [];
|
|
20
41
|
let hasSeenOptional = false;
|
|
21
42
|
for (const { parameter, index } of inputParameters(context.library, fn)) {
|
|
22
|
-
if (shouldSkip(parameter)) {
|
|
43
|
+
if (options.shouldSkip(parameter)) {
|
|
23
44
|
continue;
|
|
24
45
|
}
|
|
25
46
|
const name = parameterIdentifier(parameter, index);
|
|
26
|
-
if (isParameterOptional(parameter, isOptionalExtra)) {
|
|
47
|
+
if (isParameterOptional(parameter, options.isOptionalExtra)) {
|
|
27
48
|
hasSeenOptional = true;
|
|
28
49
|
}
|
|
29
|
-
|
|
50
|
+
const annotation = parameterAnnotation(context, fn, parameter);
|
|
51
|
+
parts.push(formatParameterPart(name, annotation, hasSeenOptional));
|
|
30
52
|
}
|
|
31
53
|
return parts.join(", ");
|
|
32
54
|
};
|
|
33
55
|
const isReturnedOutParameter = (context, parameter) => isOutParameter(parameter) ||
|
|
34
56
|
(isCallerAllocatedOut(parameter) && isCollectibleCallerOut(context, parameter)) ||
|
|
35
57
|
isInoutParameter(parameter);
|
|
36
|
-
const
|
|
58
|
+
const returnedOutParameters = (context, fn) => {
|
|
37
59
|
const folded = foldedLengthIndices(context.library, fn);
|
|
38
|
-
const
|
|
60
|
+
const result = [];
|
|
61
|
+
for (const [index, parameter] of fn.parameters.entries()) {
|
|
62
|
+
if (isReturnedOutParameter(context, parameter) && !folded.has(index)) {
|
|
63
|
+
result.push({ parameter, index });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
};
|
|
68
|
+
const renderMethodReturnType = (context, fn) => {
|
|
69
|
+
const outs = returnedOutParameters(context, fn);
|
|
39
70
|
const primary = shouldOmitPrimaryReturn(context.library, fn.returnValue)
|
|
40
71
|
? undefined
|
|
41
72
|
: renderTsType(context, fn.returnValue.type, fn.returnValue.nullable);
|
|
42
73
|
if (outs.length === 0) {
|
|
43
74
|
return primary ?? "void";
|
|
44
75
|
}
|
|
45
|
-
const outTypes = outs.map((parameter) => renderTsType(context, parameter.type, parameter.nullable));
|
|
76
|
+
const outTypes = outs.map(({ parameter }) => renderTsType(context, parameter.type, parameter.nullable));
|
|
46
77
|
return foldOutParamShape(primary, outTypes);
|
|
47
78
|
};
|
|
48
79
|
const classifyPromisifiedParameter = (promisify, parameter, index, state) => {
|
|
@@ -112,11 +143,14 @@ const promisifiedArgument = (promisify, parameter, index, hasSeenOptional) => {
|
|
|
112
143
|
if (sourceIndex !== undefined && source !== undefined) {
|
|
113
144
|
return arrayLengthArgument(source, sourceIndex);
|
|
114
145
|
}
|
|
115
|
-
return parameterCallExpression(context, parameter, index, hasSeenOptional);
|
|
146
|
+
return parameterCallExpression(context, parameter, index, { fn: asyncFn, isForcedNullable: hasSeenOptional });
|
|
116
147
|
};
|
|
117
148
|
const findCancellableIndex = (context, parameters) => parameters.findIndex((parameter) => isCancellable(context, parameter));
|
|
118
149
|
const renderPromisifiedSignature = (context, asyncFn, finishFn) => {
|
|
119
|
-
const signature = renderInputParameters(context, asyncFn,
|
|
150
|
+
const signature = renderInputParameters(context, asyncFn, {
|
|
151
|
+
shouldSkip: (parameter) => isCallbackParameter(context, parameter),
|
|
152
|
+
isOptionalExtra: (parameter) => isCancellable(context, parameter),
|
|
153
|
+
});
|
|
120
154
|
const finishReturn = renderMethodReturnType(context, finishFn);
|
|
121
155
|
return { signature, returnType: `Promise<${finishReturn}>` };
|
|
122
156
|
};
|
|
@@ -152,11 +186,12 @@ const paramDescriptorLiteral = (descriptor, options) => {
|
|
|
152
186
|
};
|
|
153
187
|
const renderReturnDescriptor = (context, fn) => {
|
|
154
188
|
const instanceOffset = fn.instance === undefined ? 0 : 1;
|
|
155
|
-
|
|
189
|
+
const descriptor = renderDescriptor(context, fn.returnValue.type, fn.returnValue.transferOwnership, {
|
|
156
190
|
argIndexOffset: instanceOffset,
|
|
157
191
|
argIndexMap: emittedArgIndices(fn, instanceOffset),
|
|
158
192
|
isNewlyCreated: fn.instance === undefined,
|
|
159
193
|
});
|
|
194
|
+
return { descriptor, isSkipped: isSkippedPrimaryReturn(context.library, fn.returnValue) };
|
|
160
195
|
};
|
|
161
196
|
const planCallArgs = (context, fn) => {
|
|
162
197
|
const plan = [];
|
|
@@ -213,6 +248,7 @@ const planInoutArgument = (context, parameter, index, planContext) => {
|
|
|
213
248
|
? { source: lengthSourceParam, index: lengthSourceIndex }
|
|
214
249
|
: undefined;
|
|
215
250
|
return planInoutParam(context, parameter, {
|
|
251
|
+
fn,
|
|
216
252
|
index,
|
|
217
253
|
argIndex: planContext.argIndex,
|
|
218
254
|
isConsumed: folded.has(index),
|
|
@@ -228,39 +264,29 @@ const planLengthArgument = (context, parameter, sourceIndex, planContext) => {
|
|
|
228
264
|
};
|
|
229
265
|
};
|
|
230
266
|
const planOutParam = (context, parameter, argIndex, isConsumed) => {
|
|
231
|
-
const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership,
|
|
267
|
+
const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, {
|
|
268
|
+
...argIndex,
|
|
269
|
+
cursor: parameter.cursor,
|
|
270
|
+
hasOutIndirection: true,
|
|
271
|
+
});
|
|
232
272
|
return {
|
|
233
273
|
paramLiteral: paramDescriptorLiteral(descriptor, { direction: "out", isConsumed }),
|
|
234
274
|
inputExpr: undefined,
|
|
235
275
|
};
|
|
236
276
|
};
|
|
237
|
-
const constructibleName = (context, ref) => {
|
|
238
|
-
let current = ref;
|
|
239
|
-
while (current !== undefined) {
|
|
240
|
-
const resolved = context.library.typeFor(current);
|
|
241
|
-
if (resolved?.kind === "alias" && resolved.value.target !== undefined) {
|
|
242
|
-
current = resolved.value.target;
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
return context.library.nameFor(current);
|
|
246
|
-
}
|
|
247
|
-
return undefined;
|
|
248
|
-
};
|
|
249
277
|
const planCallerOut = (context, parameter, argIndex) => {
|
|
250
278
|
const descriptor = renderDescriptor(context, parameter.type, "none", argIndex);
|
|
251
|
-
|
|
252
|
-
if (name !== undefined && isCollectibleCallerOut(context, parameter)) {
|
|
279
|
+
if (isCollectibleCallerOut(context, parameter)) {
|
|
253
280
|
context.addRuntimeImport("getHandle");
|
|
254
|
-
const classExpression = context.qualify(name.namespaceName, name.typeName);
|
|
255
281
|
return {
|
|
256
282
|
paramLiteral: paramDescriptorLiteral(descriptor, { direction: "out", isCallerAllocated: true }),
|
|
257
|
-
inputExpr:
|
|
283
|
+
inputExpr: renderCallerOutInstance(context, parameter),
|
|
258
284
|
};
|
|
259
285
|
}
|
|
260
286
|
return { paramLiteral: paramDescriptorLiteral(descriptor, {}), inputExpr: "undefined" };
|
|
261
287
|
};
|
|
262
288
|
const planInoutParam = (context, parameter, options) => {
|
|
263
|
-
const { index, argIndex, isConsumed, lengthSource } = options;
|
|
289
|
+
const { fn, index, argIndex, isConsumed, lengthSource } = options;
|
|
264
290
|
if (isHandlePassedInPlace(context, parameter)) {
|
|
265
291
|
const descriptor = renderDescriptor(context, parameter.type, "none", argIndex);
|
|
266
292
|
return {
|
|
@@ -272,11 +298,14 @@ const planInoutParam = (context, parameter, options) => {
|
|
|
272
298
|
inputExpr: parameterIdentifier(parameter, index),
|
|
273
299
|
};
|
|
274
300
|
}
|
|
275
|
-
const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership,
|
|
301
|
+
const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, {
|
|
302
|
+
...argIndex,
|
|
303
|
+
hasOutIndirection: true,
|
|
304
|
+
});
|
|
276
305
|
return {
|
|
277
306
|
paramLiteral: paramDescriptorLiteral(descriptor, { direction: "inout", isConsumed }),
|
|
278
307
|
inputExpr: lengthSource === undefined
|
|
279
|
-
? parameterCallExpression(context, parameter, index)
|
|
308
|
+
? parameterCallExpression(context, parameter, index, { fn })
|
|
280
309
|
: arrayLengthArgument(lengthSource.source, lengthSource.index),
|
|
281
310
|
};
|
|
282
311
|
};
|
|
@@ -287,21 +316,23 @@ const planInParam = (context, parameter, index, planContext) => {
|
|
|
287
316
|
renderDescriptor(context, parameter.type, parameter.transferOwnership, planContext.argIndex);
|
|
288
317
|
return {
|
|
289
318
|
paramLiteral: paramDescriptorLiteral(descriptor, {}),
|
|
290
|
-
inputExpr: parameterCallExpression(context, parameter, index),
|
|
319
|
+
inputExpr: parameterCallExpression(context, parameter, index, { fn }),
|
|
291
320
|
};
|
|
292
321
|
};
|
|
322
|
+
const nullableHandleExpression = (name) => `${name} == null ? null : getHandle(${name})`;
|
|
293
323
|
const handleArgument = (context, name, isNullable) => {
|
|
294
|
-
if (isNullable) {
|
|
295
|
-
context.addRuntimeImport("tryGetHandle");
|
|
296
|
-
return `tryGetHandle(${name})`;
|
|
297
|
-
}
|
|
298
324
|
context.addRuntimeImport("getHandle");
|
|
299
|
-
return `getHandle(${name})`;
|
|
325
|
+
return isNullable ? nullableHandleExpression(name) : `getHandle(${name})`;
|
|
326
|
+
};
|
|
327
|
+
const closureArgument = (context, name, isNullable) => {
|
|
328
|
+
const helper = isNullable ? "tryToClosure" : "toClosure";
|
|
329
|
+
context.addRuntimeImport(helper);
|
|
330
|
+
return `${helper}(${name})`;
|
|
300
331
|
};
|
|
301
332
|
const hashtableArgument = (context, valueRef, name) => {
|
|
302
333
|
if (isHandlePassing(context, valueRef)) {
|
|
303
|
-
context.addRuntimeImport("
|
|
304
|
-
return `${name} ? globalThis.Array.from(${name}).map(([k, v]) => [k,
|
|
334
|
+
context.addRuntimeImport("getHandle");
|
|
335
|
+
return `${name} ? globalThis.Array.from(${name}).map(([k, v]) => [k, ${nullableHandleExpression("v")}]) : null`;
|
|
305
336
|
}
|
|
306
337
|
return `${name} ? globalThis.Array.from(${name}) : null`;
|
|
307
338
|
};
|
|
@@ -322,18 +353,22 @@ const isMappableSequence = (context, type) => {
|
|
|
322
353
|
}
|
|
323
354
|
return type?.kind === "list" && isHandlePassing(context, type.element);
|
|
324
355
|
};
|
|
325
|
-
const parameterCallExpression = (context, parameter, index,
|
|
356
|
+
const parameterCallExpression = (context, parameter, index, options) => {
|
|
357
|
+
const { fn, isForcedNullable = false } = options;
|
|
326
358
|
const name = parameterIdentifier(parameter, index);
|
|
327
359
|
const ref = parameter.type;
|
|
328
360
|
if (ref === undefined) {
|
|
329
361
|
return name;
|
|
330
362
|
}
|
|
331
363
|
const isNullable = parameter.nullable || parameter.optional || isForcedNullable;
|
|
364
|
+
if (requiresClosureMarshal(context, fn, ref)) {
|
|
365
|
+
return closureArgument(context, name, isNullable);
|
|
366
|
+
}
|
|
332
367
|
if (isHandlePassing(context, ref)) {
|
|
333
368
|
return handleArgument(context, name, isNullable);
|
|
334
369
|
}
|
|
335
370
|
const type = context.library.typeFor(ref);
|
|
336
371
|
return collectionArgument(context, type, name, isNullable) ?? name;
|
|
337
372
|
};
|
|
338
|
-
export { methodExportName, renderMethodSignature, renderMethodReturnType, renderPromisifiedBody, finishCallExpression, renderPromisifiedSignature, renderMethodBody, renderReturnDescriptor, planCallArgs, };
|
|
373
|
+
export { isCallbackParameter, memberName, methodExportName, renderMethodSignature, renderMethodReturnType, returnedOutParameters, renderPromisifiedBody, finishCallExpression, renderPromisifiedSignature, renderMethodBody, renderReturnDescriptor, planCallArgs, };
|
|
339
374
|
//# sourceMappingURL=method.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.js","sourceRoot":"","sources":["../../../src/store/gi/method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAI7D,OAAO,EACH,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,GAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACH,kBAAkB,EAClB,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,GACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAqB,oBAAoB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnH,OAAO,EAAE,qBAAqB,EAAe,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAyCpG,MAAM,gBAAgB,GAAG,CAAC,EAAe,EAAU,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAEzE,MAAM,mBAAmB,GAAG,CAAC,MAAoB,EAAE,WAAmB,EAAU,EAAE;IAC9E,MAAM,UAAU,GAAG,mBAAmB,CAAC,MAAM,EAAE,WAAW,CA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AG,CAAC,EAAE,CAAC;QAChC,OAAO,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1C,OAAO,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC;AACvE,CAAC,CAAC;AAEF,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,GACf,CAAC","sourcesContent":["import { camelCase, sourceStringLiteral } from \"@gtkx/utils\";\nimport type { GirFunction } from \"../../gir/function.js\";\nimport type { GirType } from \"../../gir/type.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport {\n renderCallbackType,\n renderDescriptor,\n renderSelfDescriptor,\n shouldOmitPrimaryReturn,\n} from \"../../analysis/descriptor-render.js\";\nimport {\n arrayLengthSources,\n closureAndDestroyIndices,\n emittedArgIndices,\n foldedLengthIndices,\n foldOutParamShape,\n inputParameters,\n parameterIdentifier,\n} from \"../../analysis/param-structure.js\";\nimport { renderTsType } from \"../../analysis/ts-type.js\";\nimport { type GirParameter, isCallerAllocatedOut, isInoutParameter, isOutParameter } from \"../../gir/parameter.js\";\nimport { hasUnknownArrayLength, type TypeId } from \"../../gir/type-id.js\";\nimport { itemComparatorArgDescriptors, itemComparatorTsType } from \"./item-comparators.js\";\nimport { isCollectibleCallerOut, isHandlePassedInPlace, isHandlePassing } from \"./param-marshal.js\";\n\ntype PromisifiedStep = { hasSeenOptional: boolean; expression: string | undefined };\n\ntype PromisifyContext = {\n context: ModuleContext;\n asyncFn: GirFunction;\n closureIndices: Set<number>;\n lengthSources: Map<number, number>;\n};\n\ntype WriteMethodBodyOptions = {\n bindingExpression: string;\n returnTypeOverride?: string | undefined;\n};\n\ntype CallArgPlan = {\n paramLiteral: string;\n inputExpr: string | undefined;\n};\n\ntype ParamDescriptorOptions = {\n direction?: \"out\" | \"inout\";\n isCallerAllocated?: boolean;\n isConsumed?: boolean;\n};\n\ntype ArgIndexOptions = {\n argIndexOffset: number;\n argIndexMap: Map<number, number>;\n};\n\ntype PlanArgsContext = {\n fn: GirFunction;\n instanceOffset: number;\n argIndex: ArgIndexOptions;\n lengthSources: Map<number, number>;\n closureIndices: Set<number>;\n folded: Set<number>;\n};\n\nconst methodExportName = (fn: GirFunction): string => camelCase(fn.name);\n\nconst arrayLengthArgument = (source: GirParameter, sourceIndex: number): string => {\n const identifier = parameterIdentifier(source, sourceIndex);\n\n return source.nullable || source.optional ? `(${identifier}?.length ?? 0)` : `${identifier}.length`;\n};\n\nconst renderMethodSignature = (context: ModuleContext, fn: GirFunction): string =>\n renderInputParameters(\n context,\n fn,\n () => false,\n () => false,\n );\n\nconst parameterAnnotation = (context: ModuleContext, fn: GirFunction, parameter: GirParameter): string =>\n itemComparatorTsType(context, fn, parameter) ?? renderTsType(context, parameter.type, parameter.nullable);\n\nconst isParameterOptional = (parameter: GirParameter, isOptionalExtra: (parameter: GirParameter) => boolean): boolean =>\n parameter.optional || isOptionalExtra(parameter);\n\nconst formatParameterPart = (name: string, annotation: string, isOptional: boolean): string =>\n isOptional ? `${name}?: ${annotation}` : `${name}: ${annotation}`;\n\nconst renderInputParameters = (\n context: ModuleContext,\n fn: GirFunction,\n shouldSkip: (parameter: GirParameter) => boolean,\n isOptionalExtra: (parameter: GirParameter) => boolean,\n): string => {\n const parts: string[] = [];\n let hasSeenOptional = false;\n\n for (const { parameter, index } of inputParameters(context.library, fn)) {\n if (shouldSkip(parameter)) {\n continue;\n }\n\n const name = parameterIdentifier(parameter, index);\n\n if (isParameterOptional(parameter, isOptionalExtra)) {\n hasSeenOptional = true;\n }\n\n parts.push(formatParameterPart(name, parameterAnnotation(context, fn, parameter), hasSeenOptional));\n }\n\n return parts.join(\", \");\n};\n\nconst isReturnedOutParameter = (context: ModuleContext, parameter: GirParameter): boolean =>\n isOutParameter(parameter) ||\n (isCallerAllocatedOut(parameter) && isCollectibleCallerOut(context, parameter)) ||\n isInoutParameter(parameter);\n\nconst renderMethodReturnType = (context: ModuleContext, fn: GirFunction): string => {\n const folded = foldedLengthIndices(context.library, fn);\n const outs = fn.parameters.filter((p, index) => isReturnedOutParameter(context, p) && !folded.has(index));\n\n const primary = shouldOmitPrimaryReturn(context.library, fn.returnValue)\n ? undefined\n : renderTsType(context, fn.returnValue.type, fn.returnValue.nullable);\n\n if (outs.length === 0) {\n return primary ?? \"void\";\n }\n\n const outTypes = outs.map((parameter) => renderTsType(context, parameter.type, parameter.nullable));\n\n return foldOutParamShape(primary, outTypes);\n};\n\nconst classifyPromisifiedParameter = (\n promisify: PromisifyContext,\n parameter: GirParameter,\n index: number,\n state: { cancellableIndex: number; hasSeenOptional: boolean },\n): PromisifiedStep => {\n if (parameter.isVarargs) {\n return { hasSeenOptional: state.hasSeenOptional, expression: undefined };\n }\n\n if (index === state.cancellableIndex) {\n return { hasSeenOptional: true, expression: undefined };\n }\n\n if (shouldSkipPromisifiedParameter(promisify, parameter, index)) {\n return { hasSeenOptional: state.hasSeenOptional, expression: undefined };\n }\n\n const hasSeenOptional = state.hasSeenOptional || parameter.optional;\n\n return { hasSeenOptional, expression: promisifiedArgument(promisify, parameter, index, hasSeenOptional) };\n};\n\nconst collectPromisifiedArguments = (promisify: PromisifyContext, cancellableIndex: number): string[] => {\n const expressions: string[] = [];\n let hasSeenOptional = false;\n\n for (const [index, parameter] of promisify.asyncFn.parameters.entries()) {\n const step = classifyPromisifiedParameter(promisify, parameter, index, {\n cancellableIndex,\n hasSeenOptional,\n });\n\n hasSeenOptional = step.hasSeenOptional;\n\n if (step.expression !== undefined) {\n expressions.push(step.expression);\n }\n }\n\n return expressions;\n};\n\nconst renderCancellableExpression = (parameters: GirParameter[], cancellableIndex: number): string => {\n if (cancellableIndex < 0) {\n return \"null\";\n }\n\n const parameter = parameters[cancellableIndex];\n\n return parameter === undefined ? \"null\" : parameterIdentifier(parameter, cancellableIndex);\n};\n\nconst renderPromisifiedBody = (\n context: ModuleContext,\n asyncFn: GirFunction,\n finishExpression: string,\n bindingExpression: string,\n): string => {\n context.addRuntimeImport(\"promisify\");\n const cancellableIndex = findCancellableIndex(context, asyncFn.parameters);\n\n const promisifyContext: PromisifyContext = {\n context,\n asyncFn,\n closureIndices: closureAndDestroyIndices(asyncFn),\n lengthSources: arrayLengthSources(context.library, asyncFn),\n };\n\n const leadingExpressions: string[] = [];\n\n if (asyncFn.instance !== undefined) {\n context.addRuntimeImport(\"getHandle\");\n leadingExpressions.push(\"getHandle(this)\");\n }\n\n leadingExpressions.push(...collectPromisifiedArguments(promisifyContext, cancellableIndex));\n const cancellableExpression = renderCancellableExpression(asyncFn.parameters, cancellableIndex);\n const leadingArguments = leadingExpressions.length > 0 ? `, ${leadingExpressions.join(\", \")}` : \"\";\n\n return `return promisify(${bindingExpression}, ${finishExpression}, ${cancellableExpression}${leadingArguments});`;\n};\n\nconst finishCallExpression = (asyncFn: GirFunction, finishFn: GirFunction, ownerName: string): string =>\n asyncFn.instance !== undefined && finishFn.instance === undefined\n ? `${ownerName}.${methodExportName(finishFn)}.bind(${ownerName})`\n : `this.${methodExportName(finishFn)}.bind(this)`;\n\nconst shouldSkipPromisifiedParameter = (promisify: PromisifyContext, parameter: GirParameter, index: number): boolean =>\n isCallbackParameter(promisify.context, parameter) ||\n promisify.closureIndices.has(index) ||\n (isOutParameter(parameter) && !isCallerAllocatedOut(parameter));\n\nconst promisifiedArgument = (\n promisify: PromisifyContext,\n parameter: GirParameter,\n index: number,\n hasSeenOptional: boolean,\n): string => {\n const { context, asyncFn, lengthSources } = promisify;\n const sourceIndex = lengthSources.get(index);\n const source = sourceIndex === undefined ? undefined : asyncFn.parameters[sourceIndex];\n\n if (sourceIndex !== undefined && source !== undefined) {\n return arrayLengthArgument(source, sourceIndex);\n }\n\n return parameterCallExpression(context, parameter, index, hasSeenOptional);\n};\n\nconst findCancellableIndex = (context: ModuleContext, parameters: GirParameter[]): number =>\n parameters.findIndex((parameter) => isCancellable(context, parameter));\n\nconst renderPromisifiedSignature = (\n context: ModuleContext,\n asyncFn: GirFunction,\n finishFn: GirFunction,\n): { signature: string; returnType: string } => {\n const signature = renderInputParameters(\n context,\n asyncFn,\n (parameter) => isCallbackParameter(context, parameter),\n (parameter) => isCancellable(context, parameter),\n );\n\n const finishReturn = renderMethodReturnType(context, finishFn);\n\n return { signature, returnType: `Promise<${finishReturn}>` };\n};\n\nconst isCancellable = (context: ModuleContext, parameter: GirParameter): boolean =>\n parameter.type !== undefined && context.library.nameFor(parameter.type)?.typeName === \"Cancellable\";\n\nconst isCallbackParameter = (context: ModuleContext, parameter: GirParameter): boolean => {\n const ref = parameter.type;\n\n if (ref === undefined) {\n return false;\n }\n\n return context.library.typeFor(ref)?.kind === \"callback\";\n};\n\nconst renderMethodBody = (context: ModuleContext, fn: GirFunction, options: WriteMethodBodyOptions): string => {\n const { bindingExpression, returnTypeOverride } = options;\n\n const inputs = planCallArgs(context, fn)\n .map((arg) => arg.inputExpr)\n .filter((expression): expression is string => expression !== undefined);\n\n const callExpression = `${bindingExpression}(${inputs.join(\", \")})`;\n const annotation = returnTypeOverride ?? renderMethodReturnType(context, fn);\n\n return annotation === \"void\" ? `${callExpression};` : `return ${callExpression} as ${annotation};`;\n};\n\nconst paramDescriptorLiteral = (descriptor: string, options: ParamDescriptorOptions): string => {\n const parts = [`type: ${descriptor}`];\n\n if (options.direction !== undefined) {\n parts.push(`direction: ${sourceStringLiteral(options.direction)}`);\n }\n\n if (options.isCallerAllocated === true) {\n parts.push(\"isCallerAllocated: true\");\n }\n\n if (options.isConsumed === true) {\n parts.push(\"isConsumed: true\");\n }\n\n return `{ ${parts.join(\", \")} }`;\n};\n\nconst renderReturnDescriptor = (context: ModuleContext, fn: GirFunction): string => {\n const instanceOffset = fn.instance === undefined ? 0 : 1;\n\n return renderDescriptor(context, fn.returnValue.type, fn.returnValue.transferOwnership, {\n argIndexOffset: instanceOffset,\n argIndexMap: emittedArgIndices(fn, instanceOffset),\n isNewlyCreated: fn.instance === undefined,\n });\n};\n\nconst planCallArgs = (context: ModuleContext, fn: GirFunction): CallArgPlan[] => {\n const plan: CallArgPlan[] = [];\n\n if (fn.instance !== undefined) {\n context.addRuntimeImport(\"getHandle\");\n\n plan.push({\n paramLiteral: `{ type: ${renderSelfDescriptor(context, fn.instance)} }`,\n inputExpr: \"getHandle(this)\",\n });\n }\n\n const instanceOffset = fn.instance === undefined ? 0 : 1;\n\n const planContext: PlanArgsContext = {\n fn,\n instanceOffset,\n argIndex: { argIndexOffset: instanceOffset, argIndexMap: emittedArgIndices(fn, instanceOffset) },\n lengthSources: arrayLengthSources(context.library, fn),\n closureIndices: closureAndDestroyIndices(fn),\n folded: foldedLengthIndices(context.library, fn),\n };\n\n for (const [index, parameter] of fn.parameters.entries()) {\n const entry = planParameter(context, parameter, index, planContext);\n\n if (entry !== undefined) {\n plan.push(entry);\n }\n }\n\n return plan;\n};\n\nconst isSkippedPlanParameter = (parameter: GirParameter, index: number, closureIndices: Set<number>): boolean =>\n parameter.isVarargs || closureIndices.has(index);\n\nconst planParameter = (\n context: ModuleContext,\n parameter: GirParameter,\n index: number,\n planContext: PlanArgsContext,\n): CallArgPlan | undefined => {\n const { folded, closureIndices, lengthSources } = planContext;\n\n if (isSkippedPlanParameter(parameter, index, closureIndices)) {\n return undefined;\n }\n\n if (isOutParameter(parameter)) {\n return planOutParam(context, parameter, planContext.argIndex, folded.has(index));\n }\n\n if (isCallerAllocatedOut(parameter)) {\n return planCallerOut(context, parameter, planContext.argIndex);\n }\n\n if (isInoutParameter(parameter)) {\n return planInoutArgument(context, parameter, index, planContext);\n }\n\n const sourceIndex = lengthSources.get(index);\n\n if (sourceIndex !== undefined) {\n return planLengthArgument(context, parameter, sourceIndex, planContext);\n }\n\n return planInParam(context, parameter, index, planContext);\n};\n\nconst planInoutArgument = (\n context: ModuleContext,\n parameter: GirParameter,\n index: number,\n planContext: PlanArgsContext,\n): CallArgPlan => {\n const { fn, folded, lengthSources } = planContext;\n const lengthSourceIndex = lengthSources.get(index);\n const lengthSourceParam = lengthSourceIndex === undefined ? undefined : fn.parameters[lengthSourceIndex];\n\n const lengthSource =\n lengthSourceIndex !== undefined && lengthSourceParam !== undefined\n ? { source: lengthSourceParam, index: lengthSourceIndex }\n : undefined;\n\n return planInoutParam(context, parameter, {\n index,\n argIndex: planContext.argIndex,\n isConsumed: folded.has(index),\n lengthSource,\n });\n};\n\nconst planLengthArgument = (\n context: ModuleContext,\n parameter: GirParameter,\n sourceIndex: number,\n planContext: PlanArgsContext,\n): CallArgPlan => {\n const source = planContext.fn.parameters[sourceIndex];\n const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, planContext.argIndex);\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, {}),\n inputExpr: source === undefined ? \"0\" : arrayLengthArgument(source, sourceIndex),\n };\n};\n\nconst planOutParam = (\n context: ModuleContext,\n parameter: GirParameter,\n argIndex: ArgIndexOptions,\n isConsumed: boolean,\n): CallArgPlan => {\n const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, argIndex);\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, { direction: \"out\", isConsumed }),\n inputExpr: undefined,\n };\n};\n\nconst constructibleName = (\n context: ModuleContext,\n ref: GirParameter[\"type\"],\n): { namespaceName: string; typeName: string } | undefined => {\n let current = ref;\n\n while (current !== undefined) {\n const resolved = context.library.typeFor(current);\n\n if (resolved?.kind === \"alias\" && resolved.value.target !== undefined) {\n current = resolved.value.target;\n continue;\n }\n\n return context.library.nameFor(current);\n }\n\n return undefined;\n};\n\nconst planCallerOut = (\n context: ModuleContext,\n parameter: GirParameter,\n argIndex: ArgIndexOptions,\n): CallArgPlan => {\n const descriptor = renderDescriptor(context, parameter.type, \"none\", argIndex);\n const name = constructibleName(context, parameter.type);\n\n if (name !== undefined && isCollectibleCallerOut(context, parameter)) {\n context.addRuntimeImport(\"getHandle\");\n const classExpression = context.qualify(name.namespaceName, name.typeName);\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, { direction: \"out\", isCallerAllocated: true }),\n inputExpr: `new ${classExpression}()`,\n };\n }\n\n return { paramLiteral: paramDescriptorLiteral(descriptor, {}), inputExpr: \"undefined\" };\n};\n\nconst planInoutParam = (\n context: ModuleContext,\n parameter: GirParameter,\n options: {\n index: number;\n argIndex: ArgIndexOptions;\n isConsumed: boolean;\n lengthSource?: { source: GirParameter; index: number } | undefined;\n },\n): CallArgPlan => {\n const { index, argIndex, isConsumed, lengthSource } = options;\n\n if (isHandlePassedInPlace(context, parameter)) {\n const descriptor = renderDescriptor(context, parameter.type, \"none\", argIndex);\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, {\n direction: \"inout\",\n isCallerAllocated: true,\n isConsumed,\n }),\n inputExpr: parameterIdentifier(parameter, index),\n };\n }\n\n const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, argIndex);\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, { direction: \"inout\", isConsumed }),\n inputExpr:\n lengthSource === undefined\n ? parameterCallExpression(context, parameter, index)\n : arrayLengthArgument(lengthSource.source, lengthSource.index),\n };\n};\n\nconst planInParam = (\n context: ModuleContext,\n parameter: GirParameter,\n index: number,\n planContext: PlanArgsContext,\n): CallArgPlan => {\n const { fn } = planContext;\n\n const callback = renderCallbackType(\n context,\n parameter.type,\n parameter,\n itemComparatorArgDescriptors(context, fn, parameter),\n );\n\n const descriptor =\n callback ??\n renderDescriptor(\n context,\n parameter.type,\n parameter.transferOwnership,\n planContext.argIndex,\n );\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, {}),\n inputExpr: parameterCallExpression(context, parameter, index),\n };\n};\n\nconst handleArgument = (context: ModuleContext, name: string, isNullable: boolean): string => {\n if (isNullable) {\n context.addRuntimeImport(\"tryGetHandle\");\n\n return `tryGetHandle(${name})`;\n }\n\n context.addRuntimeImport(\"getHandle\");\n\n return `getHandle(${name})`;\n};\n\nconst hashtableArgument = (context: ModuleContext, valueRef: TypeId, name: string): string => {\n if (isHandlePassing(context, valueRef)) {\n context.addRuntimeImport(\"tryGetHandle\");\n\n return `${name} ? globalThis.Array.from(${name}).map(([k, v]) => [k, tryGetHandle(v)]) : null`;\n }\n\n return `${name} ? globalThis.Array.from(${name}) : null`;\n};\n\nconst mapHandleExpression = (name: string, isNullable: boolean): string =>\n isNullable ? `${name}?.map((item) => getHandle(item))` : `${name}.map((item) => getHandle(item))`;\n\nconst collectionArgument = (\n context: ModuleContext,\n type: GirType | undefined,\n name: string,\n isNullable: boolean,\n): string | undefined => {\n if (type?.kind === \"hashtable\") {\n return hashtableArgument(context, type.value, name);\n }\n\n if (!isMappableSequence(context, type)) {\n return undefined;\n }\n\n context.addRuntimeImport(\"getHandle\");\n\n return mapHandleExpression(name, isNullable);\n};\n\nconst isMappableSequence = (context: ModuleContext, type: GirType | undefined): boolean => {\n if (type?.kind === \"carray\") {\n return !hasUnknownArrayLength(type) && isHandlePassing(context, type.element);\n }\n\n return type?.kind === \"list\" && isHandlePassing(context, type.element);\n};\n\nconst parameterCallExpression = (\n context: ModuleContext,\n parameter: GirParameter,\n index: number,\n isForcedNullable = false,\n): string => {\n const name = parameterIdentifier(parameter, index);\n const ref = parameter.type;\n\n if (ref === undefined) {\n return name;\n }\n\n const isNullable = parameter.nullable || parameter.optional || isForcedNullable;\n\n if (isHandlePassing(context, ref)) {\n return handleArgument(context, name, isNullable);\n }\n\n const type = context.library.typeFor(ref);\n\n return collectionArgument(context, type, name, isNullable) ?? name;\n};\n\nexport {\n methodExportName,\n renderMethodSignature,\n renderMethodReturnType,\n renderPromisifiedBody,\n finishCallExpression,\n renderPromisifiedSignature,\n renderMethodBody,\n renderReturnDescriptor,\n planCallArgs,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"method.js","sourceRoot":"","sources":["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S,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ,IAAI,gBAAgB,CAAC;IAEhF,IAAI,sBAAsB,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1C,OAAO,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC;AACvE,CAAC,CAAC;AAEF,OAAO,EACH,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,GACf,CAAC","sourcesContent":["import { camelCase, sourceStringLiteral } from \"@gtkx/utils\";\nimport type { GirFunction } from \"../../gir/function.js\";\nimport type { GirType } from \"../../gir/type.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport {\n isSkippedPrimaryReturn,\n renderCallbackType,\n renderDescriptor,\n renderSelfDescriptor,\n shouldOmitPrimaryReturn,\n} from \"../../analysis/descriptor-render.js\";\nimport {\n arrayLengthSources,\n closureAndDestroyIndices,\n emittedArgIndices,\n foldedLengthIndices,\n foldOutParamShape,\n type InputParameter,\n inputParameters,\n parameterIdentifier,\n} from \"../../analysis/param-structure.js\";\nimport { renderTsType } from \"../../analysis/ts-type.js\";\nimport { type GirParameter, isCallerAllocatedOut, isInoutParameter, isOutParameter } from \"../../gir/parameter.js\";\nimport { hasUnknownArrayLength, type TypeId } from \"../../gir/type-id.js\";\nimport { areClosuresInvoked } from \"./closure-invocation.js\";\nimport { itemComparatorArgDescriptors, itemComparatorTsType } from \"./item-comparators.js\";\nimport {\n isClosureType,\n isCollectibleCallerOut,\n isHandlePassedInPlace,\n isHandlePassing,\n renderCallerOutInstance,\n} from \"./param-marshal.js\";\n\ntype PromisifiedStep = { hasSeenOptional: boolean; expression: string | undefined };\n\ntype InputParameterOptions = {\n shouldSkip: (parameter: GirParameter) => boolean;\n isOptionalExtra: (parameter: GirParameter) => boolean;\n};\n\ntype CallExpressionOptions = {\n fn: GirFunction;\n isForcedNullable?: boolean | undefined;\n};\n\ntype PromisifyContext = {\n context: ModuleContext;\n asyncFn: GirFunction;\n closureIndices: Set<number>;\n lengthSources: Map<number, number>;\n};\n\ntype WriteMethodBodyOptions = {\n bindingExpression: string;\n returnTypeOverride?: string | undefined;\n};\n\ntype CallArgPlan = {\n paramLiteral: string;\n inputExpr: string | undefined;\n};\n\ntype ReturnDescriptorPlan = {\n descriptor: string;\n isSkipped: boolean;\n};\n\ntype ParamDescriptorOptions = {\n direction?: \"out\" | \"inout\";\n isCallerAllocated?: boolean;\n isConsumed?: boolean;\n};\n\ntype ArgIndexOptions = {\n argIndexOffset: number;\n argIndexMap: Map<number, number>;\n};\n\ntype PlanArgsContext = {\n fn: GirFunction;\n instanceOffset: number;\n argIndex: ArgIndexOptions;\n lengthSources: Map<number, number>;\n closureIndices: Set<number>;\n folded: Set<number>;\n};\n\nconst memberName = (girName: string): string => {\n const camel = camelCase(girName);\n\n return /^\\d/.test(camel) ? `_${camel}` : camel;\n};\n\nconst methodExportName = (fn: GirFunction): string => memberName(fn.name);\n\nconst arrayLengthArgument = (source: GirParameter, sourceIndex: number): string => {\n const identifier = parameterIdentifier(source, sourceIndex);\n\n return source.nullable || source.optional ? `(${identifier}?.length ?? 0)` : `${identifier}.length`;\n};\n\nconst renderMethodSignature = (context: ModuleContext, fn: GirFunction): string =>\n renderInputParameters(context, fn, {\n shouldSkip: () => false,\n isOptionalExtra: () => false,\n });\n\nconst closureAnnotation = (context: ModuleContext, base: string): string => {\n context.addRuntimeTypeImport(\"ClosureCallback\");\n\n return `${base} | ClosureCallback`;\n};\n\nconst requiresClosureMarshal = (context: ModuleContext, fn: GirFunction, ref: TypeId): boolean =>\n isClosureType(context, ref) && areClosuresInvoked(fn);\n\nconst requiresClosureAnnotation = (context: ModuleContext, fn: GirFunction, parameter: GirParameter): boolean =>\n parameter.type !== undefined && requiresClosureMarshal(context, fn, parameter.type);\n\nconst parameterAnnotation = (context: ModuleContext, fn: GirFunction, parameter: GirParameter): string => {\n const comparator = itemComparatorTsType(context, fn, parameter);\n\n if (comparator !== undefined) {\n return comparator;\n }\n\n const base = renderTsType(context, parameter.type, parameter.nullable);\n\n return requiresClosureAnnotation(context, fn, parameter) ? closureAnnotation(context, base) : base;\n};\n\nconst isParameterOptional = (parameter: GirParameter, isOptionalExtra: (parameter: GirParameter) => boolean): boolean =>\n parameter.optional || isOptionalExtra(parameter);\n\nconst formatParameterPart = (name: string, annotation: string, isOptional: boolean): string =>\n isOptional ? `${name}?: ${annotation}` : `${name}: ${annotation}`;\n\nconst renderInputParameters = (context: ModuleContext, fn: GirFunction, options: InputParameterOptions): string => {\n const parts: string[] = [];\n let hasSeenOptional = false;\n\n for (const { parameter, index } of inputParameters(context.library, fn)) {\n if (options.shouldSkip(parameter)) {\n continue;\n }\n\n const name = parameterIdentifier(parameter, index);\n\n if (isParameterOptional(parameter, options.isOptionalExtra)) {\n hasSeenOptional = true;\n }\n\n const annotation = parameterAnnotation(context, fn, parameter);\n parts.push(formatParameterPart(name, annotation, hasSeenOptional));\n }\n\n return parts.join(\", \");\n};\n\nconst isReturnedOutParameter = (context: ModuleContext, parameter: GirParameter): boolean =>\n isOutParameter(parameter) ||\n (isCallerAllocatedOut(parameter) && isCollectibleCallerOut(context, parameter)) ||\n isInoutParameter(parameter);\n\nconst returnedOutParameters = (context: ModuleContext, fn: GirFunction): InputParameter[] => {\n const folded = foldedLengthIndices(context.library, fn);\n const result: InputParameter[] = [];\n\n for (const [index, parameter] of fn.parameters.entries()) {\n if (isReturnedOutParameter(context, parameter) && !folded.has(index)) {\n result.push({ parameter, index });\n }\n }\n\n return result;\n};\n\nconst renderMethodReturnType = (context: ModuleContext, fn: GirFunction): string => {\n const outs = returnedOutParameters(context, fn);\n\n const primary = shouldOmitPrimaryReturn(context.library, fn.returnValue)\n ? undefined\n : renderTsType(context, fn.returnValue.type, fn.returnValue.nullable);\n\n if (outs.length === 0) {\n return primary ?? \"void\";\n }\n\n const outTypes = outs.map(({ parameter }) => renderTsType(context, parameter.type, parameter.nullable));\n\n return foldOutParamShape(primary, outTypes);\n};\n\nconst classifyPromisifiedParameter = (\n promisify: PromisifyContext,\n parameter: GirParameter,\n index: number,\n state: { cancellableIndex: number; hasSeenOptional: boolean },\n): PromisifiedStep => {\n if (parameter.isVarargs) {\n return { hasSeenOptional: state.hasSeenOptional, expression: undefined };\n }\n\n if (index === state.cancellableIndex) {\n return { hasSeenOptional: true, expression: undefined };\n }\n\n if (shouldSkipPromisifiedParameter(promisify, parameter, index)) {\n return { hasSeenOptional: state.hasSeenOptional, expression: undefined };\n }\n\n const hasSeenOptional = state.hasSeenOptional || parameter.optional;\n\n return { hasSeenOptional, expression: promisifiedArgument(promisify, parameter, index, hasSeenOptional) };\n};\n\nconst collectPromisifiedArguments = (promisify: PromisifyContext, cancellableIndex: number): string[] => {\n const expressions: string[] = [];\n let hasSeenOptional = false;\n\n for (const [index, parameter] of promisify.asyncFn.parameters.entries()) {\n const step = classifyPromisifiedParameter(promisify, parameter, index, {\n cancellableIndex,\n hasSeenOptional,\n });\n\n hasSeenOptional = step.hasSeenOptional;\n\n if (step.expression !== undefined) {\n expressions.push(step.expression);\n }\n }\n\n return expressions;\n};\n\nconst renderCancellableExpression = (parameters: GirParameter[], cancellableIndex: number): string => {\n if (cancellableIndex < 0) {\n return \"null\";\n }\n\n const parameter = parameters[cancellableIndex];\n\n return parameter === undefined ? \"null\" : parameterIdentifier(parameter, cancellableIndex);\n};\n\nconst renderPromisifiedBody = (\n context: ModuleContext,\n asyncFn: GirFunction,\n finishExpression: string,\n bindingExpression: string,\n): string => {\n context.addRuntimeImport(\"promisify\");\n const cancellableIndex = findCancellableIndex(context, asyncFn.parameters);\n\n const promisifyContext: PromisifyContext = {\n context,\n asyncFn,\n closureIndices: closureAndDestroyIndices(asyncFn),\n lengthSources: arrayLengthSources(context.library, asyncFn),\n };\n\n const leadingExpressions: string[] = [];\n\n if (asyncFn.instance !== undefined) {\n context.addRuntimeImport(\"getHandle\");\n leadingExpressions.push(\"getHandle(this)\");\n }\n\n leadingExpressions.push(...collectPromisifiedArguments(promisifyContext, cancellableIndex));\n const cancellableExpression = renderCancellableExpression(asyncFn.parameters, cancellableIndex);\n const leadingArguments = leadingExpressions.length > 0 ? `, ${leadingExpressions.join(\", \")}` : \"\";\n\n return `return promisify(${bindingExpression}, ${finishExpression}, ${cancellableExpression}${leadingArguments});`;\n};\n\nconst finishCallExpression = (asyncFn: GirFunction, finishFn: GirFunction, ownerName: string): string =>\n asyncFn.instance !== undefined && finishFn.instance === undefined\n ? `${ownerName}.${methodExportName(finishFn)}.bind(${ownerName})`\n : `this.${methodExportName(finishFn)}.bind(this)`;\n\nconst shouldSkipPromisifiedParameter = (promisify: PromisifyContext, parameter: GirParameter, index: number): boolean =>\n isCallbackParameter(promisify.context, parameter) ||\n promisify.closureIndices.has(index) ||\n (isOutParameter(parameter) && !isCallerAllocatedOut(parameter));\n\nconst promisifiedArgument = (\n promisify: PromisifyContext,\n parameter: GirParameter,\n index: number,\n hasSeenOptional: boolean,\n): string => {\n const { context, asyncFn, lengthSources } = promisify;\n const sourceIndex = lengthSources.get(index);\n const source = sourceIndex === undefined ? undefined : asyncFn.parameters[sourceIndex];\n\n if (sourceIndex !== undefined && source !== undefined) {\n return arrayLengthArgument(source, sourceIndex);\n }\n\n return parameterCallExpression(context, parameter, index, { fn: asyncFn, isForcedNullable: hasSeenOptional });\n};\n\nconst findCancellableIndex = (context: ModuleContext, parameters: GirParameter[]): number =>\n parameters.findIndex((parameter) => isCancellable(context, parameter));\n\nconst renderPromisifiedSignature = (\n context: ModuleContext,\n asyncFn: GirFunction,\n finishFn: GirFunction,\n): { signature: string; returnType: string } => {\n const signature = renderInputParameters(context, asyncFn, {\n shouldSkip: (parameter) => isCallbackParameter(context, parameter),\n isOptionalExtra: (parameter) => isCancellable(context, parameter),\n });\n\n const finishReturn = renderMethodReturnType(context, finishFn);\n\n return { signature, returnType: `Promise<${finishReturn}>` };\n};\n\nconst isCancellable = (context: ModuleContext, parameter: GirParameter): boolean =>\n parameter.type !== undefined && context.library.nameFor(parameter.type)?.typeName === \"Cancellable\";\n\nconst isCallbackParameter = (context: ModuleContext, parameter: GirParameter): boolean => {\n const ref = parameter.type;\n\n if (ref === undefined) {\n return false;\n }\n\n return context.library.typeFor(ref)?.kind === \"callback\";\n};\n\nconst renderMethodBody = (context: ModuleContext, fn: GirFunction, options: WriteMethodBodyOptions): string => {\n const { bindingExpression, returnTypeOverride } = options;\n\n const inputs = planCallArgs(context, fn)\n .map((arg) => arg.inputExpr)\n .filter((expression): expression is string => expression !== undefined);\n\n const callExpression = `${bindingExpression}(${inputs.join(\", \")})`;\n const annotation = returnTypeOverride ?? renderMethodReturnType(context, fn);\n\n return annotation === \"void\" ? `${callExpression};` : `return ${callExpression} as ${annotation};`;\n};\n\nconst paramDescriptorLiteral = (descriptor: string, options: ParamDescriptorOptions): string => {\n const parts = [`type: ${descriptor}`];\n\n if (options.direction !== undefined) {\n parts.push(`direction: ${sourceStringLiteral(options.direction)}`);\n }\n\n if (options.isCallerAllocated === true) {\n parts.push(\"isCallerAllocated: true\");\n }\n\n if (options.isConsumed === true) {\n parts.push(\"isConsumed: true\");\n }\n\n return `{ ${parts.join(\", \")} }`;\n};\n\nconst renderReturnDescriptor = (context: ModuleContext, fn: GirFunction): ReturnDescriptorPlan => {\n const instanceOffset = fn.instance === undefined ? 0 : 1;\n\n const descriptor = renderDescriptor(context, fn.returnValue.type, fn.returnValue.transferOwnership, {\n argIndexOffset: instanceOffset,\n argIndexMap: emittedArgIndices(fn, instanceOffset),\n isNewlyCreated: fn.instance === undefined,\n });\n\n return { descriptor, isSkipped: isSkippedPrimaryReturn(context.library, fn.returnValue) };\n};\n\nconst planCallArgs = (context: ModuleContext, fn: GirFunction): CallArgPlan[] => {\n const plan: CallArgPlan[] = [];\n\n if (fn.instance !== undefined) {\n context.addRuntimeImport(\"getHandle\");\n\n plan.push({\n paramLiteral: `{ type: ${renderSelfDescriptor(context, fn.instance)} }`,\n inputExpr: \"getHandle(this)\",\n });\n }\n\n const instanceOffset = fn.instance === undefined ? 0 : 1;\n\n const planContext: PlanArgsContext = {\n fn,\n instanceOffset,\n argIndex: { argIndexOffset: instanceOffset, argIndexMap: emittedArgIndices(fn, instanceOffset) },\n lengthSources: arrayLengthSources(context.library, fn),\n closureIndices: closureAndDestroyIndices(fn),\n folded: foldedLengthIndices(context.library, fn),\n };\n\n for (const [index, parameter] of fn.parameters.entries()) {\n const entry = planParameter(context, parameter, index, planContext);\n\n if (entry !== undefined) {\n plan.push(entry);\n }\n }\n\n return plan;\n};\n\nconst isSkippedPlanParameter = (parameter: GirParameter, index: number, closureIndices: Set<number>): boolean =>\n parameter.isVarargs || closureIndices.has(index);\n\nconst planParameter = (\n context: ModuleContext,\n parameter: GirParameter,\n index: number,\n planContext: PlanArgsContext,\n): CallArgPlan | undefined => {\n const { folded, closureIndices, lengthSources } = planContext;\n\n if (isSkippedPlanParameter(parameter, index, closureIndices)) {\n return undefined;\n }\n\n if (isOutParameter(parameter)) {\n return planOutParam(context, parameter, planContext.argIndex, folded.has(index));\n }\n\n if (isCallerAllocatedOut(parameter)) {\n return planCallerOut(context, parameter, planContext.argIndex);\n }\n\n if (isInoutParameter(parameter)) {\n return planInoutArgument(context, parameter, index, planContext);\n }\n\n const sourceIndex = lengthSources.get(index);\n\n if (sourceIndex !== undefined) {\n return planLengthArgument(context, parameter, sourceIndex, planContext);\n }\n\n return planInParam(context, parameter, index, planContext);\n};\n\nconst planInoutArgument = (\n context: ModuleContext,\n parameter: GirParameter,\n index: number,\n planContext: PlanArgsContext,\n): CallArgPlan => {\n const { fn, folded, lengthSources } = planContext;\n const lengthSourceIndex = lengthSources.get(index);\n const lengthSourceParam = lengthSourceIndex === undefined ? undefined : fn.parameters[lengthSourceIndex];\n\n const lengthSource =\n lengthSourceIndex !== undefined && lengthSourceParam !== undefined\n ? { source: lengthSourceParam, index: lengthSourceIndex }\n : undefined;\n\n return planInoutParam(context, parameter, {\n fn,\n index,\n argIndex: planContext.argIndex,\n isConsumed: folded.has(index),\n lengthSource,\n });\n};\n\nconst planLengthArgument = (\n context: ModuleContext,\n parameter: GirParameter,\n sourceIndex: number,\n planContext: PlanArgsContext,\n): CallArgPlan => {\n const source = planContext.fn.parameters[sourceIndex];\n const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, planContext.argIndex);\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, {}),\n inputExpr: source === undefined ? \"0\" : arrayLengthArgument(source, sourceIndex),\n };\n};\n\nconst planOutParam = (\n context: ModuleContext,\n parameter: GirParameter,\n argIndex: ArgIndexOptions,\n isConsumed: boolean,\n): CallArgPlan => {\n const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, {\n ...argIndex,\n cursor: parameter.cursor,\n hasOutIndirection: true,\n });\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, { direction: \"out\", isConsumed }),\n inputExpr: undefined,\n };\n};\n\nconst planCallerOut = (\n context: ModuleContext,\n parameter: GirParameter,\n argIndex: ArgIndexOptions,\n): CallArgPlan => {\n const descriptor = renderDescriptor(context, parameter.type, \"none\", argIndex);\n\n if (isCollectibleCallerOut(context, parameter)) {\n context.addRuntimeImport(\"getHandle\");\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, { direction: \"out\", isCallerAllocated: true }),\n inputExpr: renderCallerOutInstance(context, parameter),\n };\n }\n\n return { paramLiteral: paramDescriptorLiteral(descriptor, {}), inputExpr: \"undefined\" };\n};\n\nconst planInoutParam = (\n context: ModuleContext,\n parameter: GirParameter,\n options: {\n fn: GirFunction;\n index: number;\n argIndex: ArgIndexOptions;\n isConsumed: boolean;\n lengthSource?: { source: GirParameter; index: number } | undefined;\n },\n): CallArgPlan => {\n const { fn, index, argIndex, isConsumed, lengthSource } = options;\n\n if (isHandlePassedInPlace(context, parameter)) {\n const descriptor = renderDescriptor(context, parameter.type, \"none\", argIndex);\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, {\n direction: \"inout\",\n isCallerAllocated: true,\n isConsumed,\n }),\n inputExpr: parameterIdentifier(parameter, index),\n };\n }\n\n const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, {\n ...argIndex,\n hasOutIndirection: true,\n });\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, { direction: \"inout\", isConsumed }),\n inputExpr:\n lengthSource === undefined\n ? parameterCallExpression(context, parameter, index, { fn })\n : arrayLengthArgument(lengthSource.source, lengthSource.index),\n };\n};\n\nconst planInParam = (\n context: ModuleContext,\n parameter: GirParameter,\n index: number,\n planContext: PlanArgsContext,\n): CallArgPlan => {\n const { fn } = planContext;\n\n const callback = renderCallbackType(\n context,\n parameter.type,\n parameter,\n itemComparatorArgDescriptors(context, fn, parameter),\n );\n\n const descriptor =\n callback ??\n renderDescriptor(\n context,\n parameter.type,\n parameter.transferOwnership,\n planContext.argIndex,\n );\n\n return {\n paramLiteral: paramDescriptorLiteral(descriptor, {}),\n inputExpr: parameterCallExpression(context, parameter, index, { fn }),\n };\n};\n\nconst nullableHandleExpression = (name: string): string => `${name} == null ? null : getHandle(${name})`;\n\nconst handleArgument = (context: ModuleContext, name: string, isNullable: boolean): string => {\n context.addRuntimeImport(\"getHandle\");\n\n return isNullable ? nullableHandleExpression(name) : `getHandle(${name})`;\n};\n\nconst closureArgument = (context: ModuleContext, name: string, isNullable: boolean): string => {\n const helper = isNullable ? \"tryToClosure\" : \"toClosure\";\n context.addRuntimeImport(helper);\n\n return `${helper}(${name})`;\n};\n\nconst hashtableArgument = (context: ModuleContext, valueRef: TypeId, name: string): string => {\n if (isHandlePassing(context, valueRef)) {\n context.addRuntimeImport(\"getHandle\");\n\n return `${name} ? globalThis.Array.from(${name}).map(([k, v]) => [k, ${nullableHandleExpression(\"v\")}]) : null`;\n }\n\n return `${name} ? globalThis.Array.from(${name}) : null`;\n};\n\nconst mapHandleExpression = (name: string, isNullable: boolean): string =>\n isNullable ? `${name}?.map((item) => getHandle(item))` : `${name}.map((item) => getHandle(item))`;\n\nconst collectionArgument = (\n context: ModuleContext,\n type: GirType | undefined,\n name: string,\n isNullable: boolean,\n): string | undefined => {\n if (type?.kind === \"hashtable\") {\n return hashtableArgument(context, type.value, name);\n }\n\n if (!isMappableSequence(context, type)) {\n return undefined;\n }\n\n context.addRuntimeImport(\"getHandle\");\n\n return mapHandleExpression(name, isNullable);\n};\n\nconst isMappableSequence = (context: ModuleContext, type: GirType | undefined): boolean => {\n if (type?.kind === \"carray\") {\n return !hasUnknownArrayLength(type) && isHandlePassing(context, type.element);\n }\n\n return type?.kind === \"list\" && isHandlePassing(context, type.element);\n};\n\nconst parameterCallExpression = (\n context: ModuleContext,\n parameter: GirParameter,\n index: number,\n options: CallExpressionOptions,\n): string => {\n const { fn, isForcedNullable = false } = options;\n const name = parameterIdentifier(parameter, index);\n const ref = parameter.type;\n\n if (ref === undefined) {\n return name;\n }\n\n const isNullable = parameter.nullable || parameter.optional || isForcedNullable;\n\n if (requiresClosureMarshal(context, fn, ref)) {\n return closureArgument(context, name, isNullable);\n }\n\n if (isHandlePassing(context, ref)) {\n return handleArgument(context, name, isNullable);\n }\n\n const type = context.library.typeFor(ref);\n\n return collectionArgument(context, type, name, isNullable) ?? name;\n};\n\nexport {\n isCallbackParameter,\n memberName,\n methodExportName,\n renderMethodSignature,\n renderMethodReturnType,\n returnedOutParameters,\n renderPromisifiedBody,\n finishCallExpression,\n renderPromisifiedSignature,\n renderMethodBody,\n renderReturnDescriptor,\n planCallArgs,\n};\n"]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { TypeId } from "../../gir/type-id.js";
|
|
2
|
+
import type { GirType } from "../../gir/type.js";
|
|
2
3
|
import type { ModuleContext } from "../../writer/context.js";
|
|
3
4
|
import { type GirParameter } from "../../gir/parameter.js";
|
|
4
5
|
declare const isHandlePassedInPlace: (context: ModuleContext, parameter: GirParameter) => boolean;
|
|
6
|
+
declare const underlyingType: (context: ModuleContext, ref: TypeId) => GirType | undefined;
|
|
7
|
+
declare const renderCallerOutInstance: (context: ModuleContext, parameter: GirParameter) => string;
|
|
5
8
|
declare const isCollectibleCallerOut: (context: ModuleContext, parameter: GirParameter) => boolean;
|
|
6
|
-
declare const
|
|
9
|
+
declare const isAllocatableCallerOut: (context: ModuleContext, parameter: GirParameter) => boolean;
|
|
7
10
|
declare const isRecordInout: (context: ModuleContext, parameter: GirParameter) => boolean;
|
|
8
11
|
declare const isHandlePassing: (context: ModuleContext, ref: TypeId) => boolean;
|
|
9
|
-
|
|
12
|
+
declare const isClosureType: (context: ModuleContext, ref: TypeId) => boolean;
|
|
13
|
+
export { isAllocatableCallerOut, isClosureType, isHandlePassedInPlace, isCollectibleCallerOut, isRecordInout, isHandlePassing, renderCallerOutInstance, underlyingType, };
|
|
10
14
|
//# sourceMappingURL=param-marshal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"param-marshal.d.ts","sourceRoot":"","sources":["../../../src/store/gi/param-marshal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"param-marshal.d.ts","sourceRoot":"","sources":["../../../src/store/gi/param-marshal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,YAAY,EAAoB,MAAM,wBAAwB,CAAC;AAO7E,QAAA,MAAM,qBAAqB,GAAI,SAAS,aAAa,EAAE,WAAW,YAAY,KAAG,OAUhF,CAAC;AAEF,QAAA,MAAM,cAAc,GAAI,SAAS,aAAa,EAAE,KAAK,MAAM,KAAG,OAAO,GAAG,SAQvE,CAAC;AAqDF,QAAA,MAAM,uBAAuB,GAAI,SAAS,aAAa,EAAE,WAAW,YAAY,KAAG,MAiBlF,CAAC;AAEF,QAAA,MAAM,sBAAsB,GAAI,SAAS,aAAa,EAAE,WAAW,YAAY,KAAG,OACzB,CAAC;AAE1D,QAAA,MAAM,sBAAsB,GAAI,SAAS,aAAa,EAAE,WAAW,YAAY,KAAG,OACoB,CAAC;AAEvG,QAAA,MAAM,aAAa,GAAI,SAAS,aAAa,EAAE,WAAW,YAAY,KAAG,OACc,CAAC;AAExF,QAAA,MAAM,eAAe,GAAI,SAAS,aAAa,EAAE,KAAK,MAAM,KAAG,OA0B9D,CAAC;AAEF,QAAA,MAAM,aAAa,GAAI,SAAS,aAAa,EAAE,KAAK,MAAM,KAAG,OAI5D,CAAC;AAEF,OAAO,EACH,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,cAAc,GACjB,CAAC"}
|