@gtkx/codegen 1.0.0-rc.3 → 1.0.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 +8 -9
- package/dist/analysis/descriptor-render.d.ts +9 -4
- package/dist/analysis/descriptor-render.d.ts.map +1 -1
- package/dist/analysis/descriptor-render.js +51 -61
- package/dist/analysis/descriptor-render.js.map +1 -1
- package/dist/analysis/descriptor.d.ts +7 -7
- package/dist/analysis/descriptor.d.ts.map +1 -1
- package/dist/analysis/descriptor.js +7 -7
- package/dist/analysis/descriptor.js.map +1 -1
- package/dist/analysis/inheritance.d.ts +1 -2
- package/dist/analysis/inheritance.d.ts.map +1 -1
- package/dist/analysis/inheritance.js +25 -22
- package/dist/analysis/inheritance.js.map +1 -1
- 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 +130 -0
- package/dist/analysis/param-capability.js.map +1 -0
- package/dist/analysis/param-structure.d.ts +13 -6
- package/dist/analysis/param-structure.d.ts.map +1 -1
- package/dist/analysis/param-structure.js +44 -20
- package/dist/analysis/param-structure.js.map +1 -1
- package/dist/analysis/ts-type.d.ts +1 -1
- package/dist/analysis/ts-type.d.ts.map +1 -1
- package/dist/analysis/ts-type.js +3 -5
- package/dist/analysis/ts-type.js.map +1 -1
- 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 +1 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +2 -1
- package/dist/compile.js.map +1 -1
- package/dist/docs/api-reference.d.ts +79 -3
- package/dist/docs/api-reference.d.ts.map +1 -1
- package/dist/docs/api-reference.js +68 -13
- 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 +32 -20
- 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 +4 -4
- package/dist/docs/pipeline.d.ts.map +1 -1
- package/dist/docs/pipeline.js +6 -6
- package/dist/docs/pipeline.js.map +1 -1
- package/dist/docs/render.d.ts +25 -5
- package/dist/docs/render.d.ts.map +1 -1
- package/dist/docs/render.js +90 -28
- package/dist/docs/render.js.map +1 -1
- package/dist/docs/symbol-page.d.ts +22 -0
- package/dist/docs/symbol-page.d.ts.map +1 -1
- package/dist/docs/symbol-page.js +129 -44
- package/dist/docs/symbol-page.js.map +1 -1
- package/dist/fingerprint.d.ts +3 -6
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +6 -8
- package/dist/fingerprint.js.map +1 -1
- package/dist/gi.d.ts +3 -11
- package/dist/gi.d.ts.map +1 -1
- package/dist/gi.js +0 -7
- package/dist/gi.js.map +1 -1
- package/dist/gir/ancestry.d.ts +2 -2
- package/dist/gir/ancestry.d.ts.map +1 -1
- package/dist/gir/ancestry.js +11 -1
- package/dist/gir/ancestry.js.map +1 -1
- package/dist/gir/annotations.d.ts +22 -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/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 -4
- package/dist/gir/field.d.ts.map +1 -1
- package/dist/gir/field.js +7 -11
- 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.map +1 -1
- package/dist/gir/gir-path.d.ts +7 -0
- package/dist/gir/gir-path.d.ts.map +1 -1
- package/dist/gir/gir-path.js +7 -0
- package/dist/gir/gir-path.js.map +1 -1
- package/dist/gir/libraries.d.ts +13 -2
- package/dist/gir/libraries.d.ts.map +1 -1
- package/dist/gir/libraries.js +11 -0
- 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 +34 -0
- package/dist/gir/library.js.map +1 -1
- package/dist/gir/namespace.d.ts +38 -0
- package/dist/gir/namespace.d.ts.map +1 -1
- package/dist/gir/namespace.js +4 -5
- package/dist/gir/namespace.js.map +1 -1
- package/dist/gir/parameter.d.ts +39 -0
- package/dist/gir/parameter.d.ts.map +1 -1
- package/dist/gir/parameter.js +7 -7
- 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 +6 -3
- 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 +0 -3
- package/dist/gir/size.js.map +1 -1
- package/dist/gir/type-id.d.ts +36 -1
- package/dist/gir/type-id.d.ts.map +1 -1
- package/dist/gir/type-id.js +2 -3
- 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 +2 -1
- 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/index.d.ts +18 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +3 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +3 -0
- package/dist/internal.js.map +1 -0
- package/dist/jsx.d.ts +7 -12
- package/dist/jsx.d.ts.map +1 -1
- package/dist/jsx.js +18 -19
- package/dist/jsx.js.map +1 -1
- package/dist/khronos/args.d.ts +7 -6
- package/dist/khronos/args.d.ts.map +1 -1
- package/dist/khronos/args.js +29 -7
- 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 +96 -26
- 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/pipeline.d.ts +3 -1
- package/dist/khronos/pipeline.d.ts.map +1 -1
- package/dist/khronos/pipeline.js +59 -28
- package/dist/khronos/pipeline.js.map +1 -1
- package/dist/khronos/plan.d.ts +5 -5
- package/dist/khronos/plan.d.ts.map +1 -1
- package/dist/khronos/plan.js +8 -8
- 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 +16 -10
- package/dist/react/element-config.d.ts.map +1 -1
- package/dist/react/element-config.js +22 -15
- package/dist/react/element-config.js.map +1 -1
- package/dist/runner.d.ts +33 -21
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +19 -20
- package/dist/runner.js.map +1 -1
- package/dist/store/compile-store.d.ts +2 -3
- package/dist/store/compile-store.d.ts.map +1 -1
- package/dist/store/compile-store.js +2 -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 +3 -1
- package/dist/store/gi/callables.d.ts.map +1 -1
- package/dist/store/gi/callables.js +16 -16
- 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 +2 -2
- 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 +5 -3
- 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/constant.d.ts.map +1 -1
- package/dist/store/gi/constant.js +3 -4
- 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 +29 -16
- package/dist/store/gi/enum.js.map +1 -1
- package/dist/store/gi/function.d.ts.map +1 -1
- package/dist/store/gi/function.js +28 -17
- package/dist/store/gi/function.js.map +1 -1
- package/dist/store/gi/interface.d.ts.map +1 -1
- package/dist/store/gi/interface.js +130 -16
- 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 +9 -1
- package/dist/store/gi/method.d.ts.map +1 -1
- package/dist/store/gi/method.js +92 -47
- package/dist/store/gi/method.js.map +1 -1
- package/dist/store/gi/param-marshal.d.ts +4 -1
- package/dist/store/gi/param-marshal.d.ts.map +1 -1
- package/dist/store/gi/param-marshal.js +5 -1
- 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 +3 -2
- package/dist/store/gi/pipeline.js.map +1 -1
- package/dist/store/gi/properties.d.ts.map +1 -1
- package/dist/store/gi/properties.js +2 -2
- package/dist/store/gi/properties.js.map +1 -1
- package/dist/store/gi/property-accessor.d.ts +4 -2
- package/dist/store/gi/property-accessor.d.ts.map +1 -1
- package/dist/store/gi/property-accessor.js +10 -11
- package/dist/store/gi/property-accessor.js.map +1 -1
- package/dist/store/gi/record-constructor.d.ts.map +1 -1
- package/dist/store/gi/record-constructor.js +3 -1
- package/dist/store/gi/record-constructor.js.map +1 -1
- package/dist/store/gi/record-field-accessor.d.ts +4 -2
- package/dist/store/gi/record-field-accessor.d.ts.map +1 -1
- package/dist/store/gi/record-field-accessor.js +6 -11
- package/dist/store/gi/record-field-accessor.js.map +1 -1
- package/dist/store/gi/record-layout.d.ts.map +1 -1
- package/dist/store/gi/record-layout.js +1 -5
- 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 +3 -2
- package/dist/store/gi/record.js.map +1 -1
- package/dist/store/gi/registration.d.ts +1 -1
- package/dist/store/gi/registration.js +2 -2
- package/dist/store/gi/registration.js.map +1 -1
- package/dist/store/gi/return-wrap.d.ts +1 -1
- package/dist/store/gi/return-wrap.d.ts.map +1 -1
- package/dist/store/gi/return-wrap.js +4 -4
- package/dist/store/gi/return-wrap.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.map +1 -1
- package/dist/store/gi/signal.js +27 -31
- package/dist/store/gi/signal.js.map +1 -1
- package/dist/store/gi/value-marshalable.d.ts +1 -10
- package/dist/store/gi/value-marshalable.d.ts.map +1 -1
- package/dist/store/gi/value-marshalable.js +1 -10
- package/dist/store/gi/value-marshalable.js.map +1 -1
- package/dist/store/gi/vtable.d.ts +16 -1
- package/dist/store/gi/vtable.d.ts.map +1 -1
- package/dist/store/gi/vtable.js +214 -51
- package/dist/store/gi/vtable.js.map +1 -1
- package/dist/store/gi-store.d.ts +2 -3
- package/dist/store/gi-store.d.ts.map +1 -1
- package/dist/store/gi-store.js.map +1 -1
- package/dist/store/jsx/element-components.d.ts +1 -3
- package/dist/store/jsx/element-components.d.ts.map +1 -1
- package/dist/store/jsx/element-components.js +6 -8
- package/dist/store/jsx/element-components.js.map +1 -1
- package/dist/store/jsx/element-prop-imports.d.ts +1 -4
- package/dist/store/jsx/element-prop-imports.d.ts.map +1 -1
- package/dist/store/jsx/element-prop-imports.js +0 -2
- package/dist/store/jsx/element-prop-imports.js.map +1 -1
- package/dist/store/jsx/element-prop-types.d.ts +3 -1
- package/dist/store/jsx/element-prop-types.d.ts.map +1 -1
- package/dist/store/jsx/element-prop-types.js +7 -2
- package/dist/store/jsx/element-prop-types.js.map +1 -1
- package/dist/store/jsx/generated-elements.d.ts +29 -0
- package/dist/store/jsx/generated-elements.d.ts.map +1 -0
- package/dist/store/jsx/generated-elements.js +30 -0
- package/dist/store/jsx/generated-elements.js.map +1 -0
- 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 +13 -12
- package/dist/store/jsx/jsx.js.map +1 -1
- package/dist/store/jsx/metadata.js +9 -9
- package/dist/store/jsx/metadata.js.map +1 -1
- package/dist/store/jsx/omitted-props.d.ts +2 -4
- package/dist/store/jsx/omitted-props.d.ts.map +1 -1
- package/dist/store/jsx/omitted-props.js +2 -4
- package/dist/store/jsx/omitted-props.js.map +1 -1
- package/dist/store/jsx/pipeline.d.ts +4 -2
- package/dist/store/jsx/pipeline.d.ts.map +1 -1
- package/dist/store/jsx/pipeline.js +3 -2
- 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 +16 -8
- package/dist/store/jsx/props.js.map +1 -1
- package/dist/store/jsx-store.d.ts +2 -3
- 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 +28 -0
- package/dist/store/resolve-store.d.ts.map +1 -0
- package/dist/store/resolve-store.js +65 -0
- package/dist/store/resolve-store.js.map +1 -0
- package/dist/store/store-fs.d.ts +5 -1
- package/dist/store/store-fs.d.ts.map +1 -1
- package/dist/store/store-fs.js +6 -4
- package/dist/store/store-fs.js.map +1 -1
- package/dist/writer/context.d.ts +2 -1
- package/dist/writer/context.d.ts.map +1 -1
- package/dist/writer/context.js +3 -0
- 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 +8 -2
- package/dist/writer/module.d.ts.map +1 -1
- package/dist/writer/module.js +13 -1
- package/dist/writer/module.js.map +1 -1
- package/overrides/gdk/rgba.ts.ejs +26 -0
- package/overrides/gobject/object.ts.ejs +56 -11
- package/overrides/gobject/value.ts.ejs +7 -0
- package/overrides/graphene/structs.ts.ejs +55 -0
- package/package.json +7 -11
- package/src/analysis/descriptor-render.ts +67 -73
- package/src/analysis/descriptor.ts +13 -16
- package/src/analysis/inheritance.ts +35 -34
- package/src/analysis/nul-terminated-bytes.ts +31 -0
- package/src/analysis/param-capability.ts +172 -0
- package/src/analysis/param-structure.ts +90 -32
- package/src/analysis/ts-type.ts +4 -6
- package/src/analysis/type-shape.ts +24 -0
- package/src/compile.ts +3 -2
- package/src/docs/api-reference.ts +162 -28
- package/src/docs/element-page.ts +53 -47
- package/src/docs/handwritten-props.ts +230 -0
- package/src/docs/pipeline.ts +10 -10
- package/src/docs/render.ts +153 -39
- package/src/docs/symbol-page.ts +230 -80
- package/src/fingerprint.ts +8 -14
- package/src/gi.ts +4 -11
- package/src/gir/ancestry.ts +15 -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/enum.ts +30 -10
- package/src/gir/field.ts +24 -13
- package/src/gir/function.ts +15 -0
- package/src/gir/gir-path.ts +7 -0
- package/src/gir/libraries.ts +23 -2
- package/src/gir/library.ts +51 -2
- package/src/gir/namespace.ts +41 -5
- package/src/gir/parameter.ts +47 -7
- package/src/gir/parse.ts +8 -2
- 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 -6
- package/src/gir/type-id.ts +51 -7
- package/src/gir/type-ref.ts +2 -1
- package/src/gir/type.ts +50 -6
- package/src/index.ts +18 -16
- package/src/internal.ts +2 -0
- package/src/jsx.ts +26 -26
- package/src/khronos/args.ts +37 -14
- 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 +134 -40
- package/src/khronos/notes.ts +74 -0
- package/src/khronos/param-pair.ts +1 -1
- package/src/khronos/pipeline.ts +95 -42
- package/src/khronos/plan.ts +12 -13
- package/src/khronos/render.ts +62 -50
- package/src/khronos/select.ts +91 -50
- package/src/react/element-config.ts +21 -18
- package/src/runner.ts +51 -40
- package/src/store/compile-store.ts +4 -5
- package/src/store/gi/callable-doc.ts +102 -0
- package/src/store/gi/callables.ts +23 -17
- package/src/store/gi/callback.ts +3 -2
- package/src/store/gi/class.ts +6 -3
- package/src/store/gi/closure-invocation.ts +26 -0
- package/src/store/gi/constant.ts +3 -6
- package/src/store/gi/constructor-props.ts +19 -23
- package/src/store/gi/doc-spec.ts +38 -0
- package/src/store/gi/enum.ts +55 -20
- package/src/store/gi/function.ts +44 -26
- package/src/store/gi/interface.ts +214 -26
- package/src/store/gi/item-comparators.ts +3 -5
- package/src/store/gi/method.ts +126 -68
- package/src/store/gi/param-marshal.ts +15 -1
- package/src/store/gi/pipeline.ts +7 -2
- package/src/store/gi/properties.ts +3 -2
- package/src/store/gi/property-accessor.ts +14 -11
- package/src/store/gi/record-constructor.ts +6 -1
- package/src/store/gi/record-field-accessor.ts +9 -13
- package/src/store/gi/record-layout.ts +1 -5
- package/src/store/gi/record.ts +8 -2
- package/src/store/gi/registration.ts +3 -3
- package/src/store/gi/return-wrap.ts +5 -5
- package/src/store/gi/runtime-override.ts +13 -6
- package/src/store/gi/signal.ts +36 -37
- package/src/store/gi/value-marshalable.ts +1 -10
- package/src/store/gi/vtable.ts +361 -60
- package/src/store/gi-store.ts +2 -4
- package/src/store/jsx/element-components.ts +8 -11
- package/src/store/jsx/element-prop-imports.ts +6 -5
- package/src/store/jsx/element-prop-types.ts +10 -2
- package/src/store/jsx/generated-elements.ts +60 -0
- package/src/store/jsx/intrinsic-elements.ts +4 -0
- package/src/store/jsx/jsx.ts +15 -13
- package/src/store/jsx/metadata.ts +10 -10
- package/src/store/jsx/omitted-props.ts +2 -4
- package/src/store/jsx/pipeline.ts +6 -4
- package/src/store/jsx/props.ts +22 -9
- package/src/store/jsx-store.ts +5 -7
- package/src/store/resolve-store.ts +100 -0
- package/src/store/store-fs.ts +12 -5
- package/src/writer/context.ts +5 -1
- 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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AAC,CAAC,CAAC;IAExF,OAAO,gBAAgB,SAAS,CAAC,SAAS,CAAC,wBAAwB,eAAe,GAAG,CAAC;AAC1F,CAAC,CAAC;AAEF,MAAM,8BAA8B,GAAG,CAAC,OAAsB,EAAE,KAAe,EAAE,SAAoB,EAAY,EAAE,CAAC;IAChH,GAAG,sBAAsB,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;QACjD,YAAY,EAAE,yBAAyB;QACvC,cAAc,EAAE,sBAAsB;KACzC,CAAC;IACF,GAAG,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC;CACzC,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { pascalCase } from \"@gtkx/utils\";\nimport type { GirClass } from \"../../gir/class.js\";\nimport type { GirFunction } from \"../../gir/function.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport { reservedSignalMemberRename, resolvePrerequisiteReference } from \"../../analysis/inheritance.js\";\nimport { renderJsDoc } from \"../../writer/doc.js\";\nimport { renderBlock, renderBracedOrEmpty } from \"../../writer/emit.js\";\nimport {\n type Callables,\n dedupeCallables,\n generateBindings,\n type InstanceScope,\n instanceScope,\n renderClassInstanceMember,\n renderInstanceMethodSignature,\n renderStaticHead,\n} from \"./callables.js\";\nimport { renderSourceGtype } from \"./gtype-binding.js\";\nimport { methodExportName } from \"./method.js\";\nimport {\n type PropertyAccessorArgs,\n renderPropertyAccessor,\n renderPropertyAccessorSignature,\n} from \"./property-accessor.js\";\nimport { appendInterfaceRegistration } from \"./registration.js\";\nimport { renderSignalDeclarations, renderSignalMembers } from \"./signal.js\";\nimport { renderVfuncMetadata } from \"./vtable.js\";\n\ntype InterfaceMemberRenderers = {\n renderMethod: (\n context: ModuleContext,\n callable: GirFunction,\n scope: InstanceScope,\n nameOverride?: string,\n ) => string | undefined;\n renderProperty: (args: PropertyAccessorArgs) => string | undefined;\n};\n\ntype MethodMemberOptions = {\n context: ModuleContext;\n className: string;\n scope: InstanceScope;\n callables: Callables;\n renderers: InterfaceMemberRenderers;\n claimedNames: Set<string>;\n};\n\ntype PropertyMemberOptions = {\n context: ModuleContext;\n iface: GirClass;\n scope: InstanceScope;\n renderers: InterfaceMemberRenderers;\n claimedNames: Set<string>;\n};\n\nconst generateInterface = (context: ModuleContext, iface: GirClass): void => {\n if (!iface.introspectable) {\n return;\n }\n\n if (iface.name.length === 0) {\n return;\n }\n\n const className = pascalCase(iface.name);\n\n const callables: Callables = {\n constructors: dedupeCallables(iface.constructors),\n functions: dedupeCallables(iface.functions),\n methods: dedupeCallables(iface.methods),\n };\n\n generateBindings(context, callables);\n const gtypeExpr = renderSourceGtype(context, iface);\n context.module.appendDeclaration(renderInterfaceType(context, iface, className, callables));\n context.module.appendDeclaration(renderInterfaceClass(context, className, callables, gtypeExpr));\n\n for (const declaration of renderSignalDeclarations(context, iface, className, true)) {\n context.module.appendDeclaration(declaration);\n }\n\n context.module.appendDeclaration(renderInterfaceMaker(context, iface, className, callables));\n\n appendInterfaceRegistration(context, {\n className,\n makerName: makerName(className),\n gtypeExpr,\n vfuncs: renderVfuncMetadata(context, iface),\n });\n};\n\nconst makerName = (className: string): string => `make${className}`;\n\nconst interfaceTypeExtends = (context: ModuleContext, iface: GirClass): string => {\n const refs = iface.prerequisites\n .map((name) => resolvePrerequisiteReference(context, name))\n .filter((entry): entry is string => entry !== undefined);\n\n if (refs.length > 0) {\n return refs.join(\", \");\n }\n\n return context.qualify(\"GObject\", \"Object\");\n};\n\nconst renderInterfaceType = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string => {\n const members = renderInterfaceTypeMembers(context, iface, callables);\n\n return `${renderJsDoc(iface.doc)}${renderBracedOrEmpty(\n `export interface ${className} extends ${interfaceTypeExtends(context, iface)}`,\n members.join(\"\\n\"),\n )}`;\n};\n\nconst collectMethodMembers = (options: MethodMemberOptions): string[] => {\n const { context, className, scope, callables, renderers, claimedNames } = options;\n const members: string[] = [];\n\n for (const callable of callables.methods) {\n const rename = reservedSignalMemberRename(className, callable);\n const block = renderers.renderMethod(context, callable, scope, rename);\n\n if (block === undefined) {\n continue;\n }\n\n members.push(block);\n claimedNames.add(rename ?? methodExportName(callable));\n }\n\n return members;\n};\n\nconst collectPropertyMembers = (options: PropertyMemberOptions): string[] => {\n const { context, iface, scope, renderers, claimedNames } = options;\n const members: string[] = [];\n\n for (const property of iface.properties) {\n const block = renderers.renderProperty({ context, property, claimedNames, methodByName: scope.methodByName });\n\n if (block !== undefined) {\n members.push(block);\n }\n }\n\n return members;\n};\n\nconst renderInterfaceMembers = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n renderers: InterfaceMemberRenderers,\n): string[] => {\n const className = pascalCase(iface.name);\n const scope = instanceScope(className, callables);\n const claimedNames: Set<string> = new Set();\n const methodMembers = collectMethodMembers({ context, className, scope, callables, renderers, claimedNames });\n const propertyMembers = collectPropertyMembers({ context, iface, scope, renderers, claimedNames });\n\n return [...methodMembers, ...propertyMembers];\n};\n\nconst renderInterfaceTypeMembers = (context: ModuleContext, iface: GirClass, callables: Callables): string[] =>\n renderInterfaceMembers(context, iface, callables, {\n renderMethod: renderInstanceMethodSignature,\n renderProperty: renderPropertyAccessorSignature,\n });\n\nconst renderInterfaceClass = (\n context: ModuleContext,\n className: string,\n callables: Callables,\n gtypeExpr: string | undefined,\n): string => {\n const members: string[] = [];\n\n if (gtypeExpr !== undefined) {\n members.push(renderInterfaceHasInstance(context, className, gtypeExpr));\n }\n\n members.push(...renderStaticHead(context, callables, className));\n\n return renderBracedOrEmpty(`export abstract class ${className}`, members.join(\"\\n\\n\"));\n};\n\nconst renderInterfaceHasInstance = (context: ModuleContext, className: string, gtypeExpr: string): string => {\n context.addRuntimeImport(\"valueIsA\");\n\n return renderBlock(\n `static [Symbol.hasInstance](value: unknown): value is ${className}`,\n `return valueIsA(value, ${gtypeExpr});`,\n );\n};\n\nconst renderInterfaceMaker = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string => {\n context.addRuntimeTypeImport(\"Mixin\");\n const members = renderInterfaceInstanceMembers(context, iface, callables);\n const classExpression = renderBracedOrEmpty(\"class extends Base\", members.join(\"\\n\\n\"));\n\n return `export const ${makerName(className)}: Mixin = (Base) =>\\n${classExpression};`;\n};\n\nconst renderInterfaceInstanceMembers = (context: ModuleContext, iface: GirClass, callables: Callables): string[] => [\n ...renderInterfaceMembers(context, iface, callables, {\n renderMethod: renderClassInstanceMember,\n renderProperty: renderPropertyAccessor,\n }),\n ...renderSignalMembers(context, iface),\n];\n\nexport { generateInterface };\n"]}
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/store/gi/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAI9D,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AACzG,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAEH,eAAe,EACf,gBAAgB,EAGhB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,6BAA6B,EAC7B,gBAAgB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAEH,sBAAsB,EACtB,+BAA+B,GAClC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,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AAE,CAAC","sourcesContent":["import { pascalCase, sourceStringLiteral } from \"@gtkx/utils\";\nimport type { GirClass } from \"../../gir/class.js\";\nimport type { GirProperty } from \"../../gir/property.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport { reservedSignalMemberRename, resolvePrerequisiteReference } from \"../../analysis/inheritance.js\";\nimport { resolveInterfaces } from \"../../gir/ancestry.js\";\nimport { renderJsDoc } from \"../../writer/doc.js\";\nimport { renderBlock, renderBraced, renderBracedOrEmpty } from \"../../writer/emit.js\";\nimport {\n type Callables,\n dedupeCallables,\n generateBindings,\n type InstanceMemberRenderer,\n type InstanceScope,\n instanceScope,\n isEmittableCallable,\n renderClassInstanceMember,\n renderInstanceMethodSignature,\n renderStaticHead,\n} from \"./callables.js\";\nimport { annotationSpec, getDoc } from \"./doc-spec.js\";\nimport { renderSourceGtype } from \"./gtype-binding.js\";\nimport { methodExportName } from \"./method.js\";\nimport {\n type PropertyAccessorArgs,\n renderPropertyAccessor,\n renderPropertyAccessorSignature,\n} from \"./property-accessor.js\";\nimport { appendInterfaceRegistration } from \"./registration.js\";\nimport { renderSignalDeclarations, renderSignalMembers } from \"./signal.js\";\nimport {\n hasCallableVfuncSlots,\n renderVfuncMembers,\n renderVfuncMetadata,\n type VfuncMemberMode,\n} from \"./vtable.js\";\n\ntype InterfaceMemberRenderers = {\n renderMethod: InstanceMemberRenderer;\n renderProperty: (args: PropertyAccessorArgs) => string | undefined;\n};\n\ntype MethodMemberOptions = {\n context: ModuleContext;\n className: string;\n scope: InstanceScope;\n callables: Callables;\n renderers: InterfaceMemberRenderers;\n claimedNames: Set<string>;\n};\n\ntype PropertyMemberOptions = {\n context: ModuleContext;\n iface: GirClass;\n scope: InstanceScope;\n renderers: InterfaceMemberRenderers;\n claimedNames: Set<string>;\n};\n\ntype InterfaceClassOptions = {\n iface: GirClass;\n className: string;\n callables: Callables;\n gtypeExpr: string | undefined;\n implRef: string;\n};\n\nconst BRAND_NOTE = [\n \"Phantom link to the type a class fills to adopt the interface, which `registerClass` reads\",\n \"through its `implements` option. It holds no value at runtime. `unknown` asks nothing of the\",\n \"class, which is what an interface with no slot to fill carries.\",\n].join(\"\\n\");\n\nconst generateInterface = (context: ModuleContext, iface: GirClass): void => {\n if (!iface.introspectable) {\n return;\n }\n\n if (iface.name.length === 0) {\n return;\n }\n\n const className = pascalCase(iface.name);\n\n const callables: Callables = {\n constructors: dedupeCallables(iface.constructors),\n functions: dedupeCallables(iface.functions),\n methods: dedupeCallables(iface.methods),\n };\n\n generateBindings(context, callables);\n const gtypeExpr = renderSourceGtype(context, iface);\n const implRef = appendInterfaceTypes(context, iface, className, callables) ?? \"unknown\";\n const classCode = renderInterfaceClass(context, { iface, className, callables, gtypeExpr, implRef });\n context.module.appendDeclaration(classCode, context.declaredType(className));\n\n for (const declaration of renderSignalDeclarations(context, iface, className, true)) {\n context.module.appendDeclaration(declaration);\n }\n\n context.module.appendDeclaration(renderInterfaceMaker(context, iface, className, callables));\n\n appendInterfaceRegistration(context, {\n className,\n makerName: makerName(className),\n gtypeExpr,\n layout: renderInterfaceLayout(context, iface, callables),\n });\n};\n\nconst makerName = (className: string): string => `make${className}`;\n\nconst renderInterfaceLayout = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n): string | undefined => {\n const vfuncs = renderVfuncMetadata(context, iface);\n const properties = renderSlotBackedProperties(context, iface, callables);\n\n if (vfuncs === undefined && properties === undefined) {\n return undefined;\n }\n\n const entries: string[] = [];\n\n if (vfuncs !== undefined) {\n entries.push(`vfuncs: ${vfuncs},`);\n }\n\n if (properties !== undefined) {\n entries.push(`properties: ${properties},`);\n }\n\n return renderBraced(entries.join(\"\\n\"));\n};\n\nconst invokerMembers = (context: ModuleContext, iface: GirClass, callables: Callables): Map<string, string> => {\n const className = pascalCase(iface.name);\n\n const invokers: Set<string> = new Set(\n iface.vfuncs.map((vfunc) => vfunc.invoker).filter((invoker) => invoker !== undefined),\n );\n\n const members: Map<string, string> = new Map();\n\n for (const callable of callables.methods) {\n if (invokers.has(callable.name) && isEmittableCallable(context, callable)) {\n members.set(callable.name, reservedSignalMemberRename(className, callable) ?? methodExportName(callable));\n }\n }\n\n return members;\n};\n\nconst renderSlotAccessor = (\n key: string,\n method: string | undefined,\n members: Map<string, string>,\n): string | undefined => {\n const member = method === undefined ? undefined : members.get(method);\n\n return member === undefined ? undefined : `${key}: ${sourceStringLiteral(member)},`;\n};\n\nconst renderSlotBackedProperty = (property: GirProperty, members: Map<string, string>): string | undefined => {\n if (!property.introspectable) {\n return undefined;\n }\n\n const fields = [\n renderSlotAccessor(\"getter\", property.getter, members),\n renderSlotAccessor(\"setter\", property.setter, members),\n ].filter((field) => field !== undefined);\n\n if (fields.length === 0) {\n return undefined;\n }\n\n return `${sourceStringLiteral(property.name)}: ${renderBraced(fields.join(\"\\n\"))},`;\n};\n\nconst renderSlotBackedProperties = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n): string | undefined => {\n const members = invokerMembers(context, iface, callables);\n\n const entries = iface.properties\n .map((property) => renderSlotBackedProperty(property, members))\n .filter((entry) => entry !== undefined);\n\n return entries.length === 0 ? undefined : renderBraced(entries.join(\"\\n\"));\n};\n\nconst appendInterfaceTypes = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string | undefined => {\n const typeCode = renderInterfaceType(context, iface, className, callables);\n context.module.appendDeclaration(typeCode, context.declaredType(className));\n const implType = renderInterfaceImplType(context, iface, className);\n\n if (implType === undefined) {\n return undefined;\n }\n\n const implName = implTypeName(className);\n context.module.appendDeclaration(implType, context.declaredType(className, implName));\n\n return implName;\n};\n\nconst interfaceTypeExtends = (context: ModuleContext, iface: GirClass): string => {\n const refs = iface.prerequisites\n .map((name) => resolvePrerequisiteReference(context, name))\n .filter((entry): entry is string => entry !== undefined);\n\n if (refs.length > 0) {\n return refs.join(\", \");\n }\n\n return context.qualify(\"GObject\", \"Object\");\n};\n\nconst renderInterfaceType = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string => {\n const members = renderInterfaceTypeMembers(context, iface, callables);\n\n return `${getDoc(iface)}${renderBracedOrEmpty(\n `export interface ${className} extends ${interfaceTypeExtends(context, iface)}`,\n members.join(\"\\n\"),\n )}`;\n};\n\nconst implTypeName = (className: string): string => `${className}Impl`;\n\nconst implTypeNote = (className: string): string =>\n [\n `Implementer side of \\`${className}\\`: the vtable slots a class fills to adopt the interface.`,\n \"\",\n `Declare it with \\`implements ${implTypeName(className)}\\` on a class passed to \\`registerClass\\``,\n `with \\`${className}\\` in \\`implements\\`. The interface's methods, properties, and signals come from`,\n \"GLib dispatch, so they are not part of this type.\",\n \"\",\n \"Every slot is optional: an unfilled one keeps whatever the interface installs by default, and a\",\n \"GIR update can add one. Declaring a slot pins its signature; declaring it as a class field rather\",\n \"than a method satisfies this type but never reaches the vtable.\",\n ].join(\"\\n\");\n\nconst implPrerequisiteRefs = (context: ModuleContext, iface: GirClass): string[] => {\n const prerequisites = resolveInterfaces(context.library, context.namespace.name, iface.prerequisites);\n const refs: string[] = [];\n\n for (const prerequisite of prerequisites) {\n if (!hasCallableVfuncSlots(context, prerequisite.namespaceName, prerequisite.klass)) {\n continue;\n }\n\n const name = implTypeName(pascalCase(prerequisite.klass.name));\n refs.push(context.qualify(prerequisite.namespaceName, name));\n }\n\n return refs;\n};\n\nconst implTypeExtends = (context: ModuleContext, iface: GirClass): string => {\n const refs = implPrerequisiteRefs(context, iface);\n\n return refs.length > 0 ? ` extends ${refs.join(\", \")}` : \"\";\n};\n\nconst interfaceVfuncMembers = (context: ModuleContext, iface: GirClass, mode: VfuncMemberMode): string[] =>\n renderVfuncMembers({ context, klass: iface, mode });\n\nconst renderInterfaceImplType = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n): string | undefined => {\n const members = interfaceVfuncMembers(context, iface, \"requirement\");\n\n if (members.length === 0) {\n return undefined;\n }\n\n return `${renderJsDoc(iface.doc, implTypeNote(className), annotationSpec(iface.annotations))}${renderBracedOrEmpty(\n `export interface ${implTypeName(className)}${implTypeExtends(context, iface)}`,\n members.join(\"\\n\"),\n )}`;\n};\n\nconst collectMethodMembers = (options: MethodMemberOptions): string[] => {\n const { context, className, scope, callables, renderers, claimedNames } = options;\n const members: string[] = [];\n\n for (const callable of callables.methods) {\n const rename = reservedSignalMemberRename(className, callable);\n const block = renderers.renderMethod(context, callable, scope, rename);\n\n if (block === undefined) {\n continue;\n }\n\n members.push(block);\n claimedNames.add(rename ?? methodExportName(callable));\n }\n\n return members;\n};\n\nconst collectPropertyMembers = (options: PropertyMemberOptions): string[] => {\n const { context, iface, scope, renderers, claimedNames } = options;\n const members: string[] = [];\n\n for (const property of iface.properties) {\n const block = renderers.renderProperty({ context, property, claimedNames, methodByName: scope.methodByName });\n\n if (block !== undefined) {\n members.push(block);\n }\n }\n\n return members;\n};\n\nconst renderInterfaceMembers = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n renderers: InterfaceMemberRenderers,\n): string[] => {\n const className = pascalCase(iface.name);\n const scope = instanceScope(className, callables);\n const claimedNames: Set<string> = new Set();\n const methodMembers = collectMethodMembers({ context, className, scope, callables, renderers, claimedNames });\n const propertyMembers = collectPropertyMembers({ context, iface, scope, renderers, claimedNames });\n\n return [...methodMembers, ...propertyMembers];\n};\n\nconst renderInterfaceTypeMembers = (context: ModuleContext, iface: GirClass, callables: Callables): string[] => [\n ...renderInterfaceMembers(context, iface, callables, {\n renderMethod: renderInstanceMethodSignature,\n renderProperty: renderPropertyAccessorSignature,\n }),\n ...interfaceVfuncMembers(context, iface, \"signature\"),\n];\n\nconst renderInterfaceClass = (context: ModuleContext, options: InterfaceClassOptions): string => {\n const { iface, className, callables, gtypeExpr, implRef } = options;\n const members: string[] = [];\n\n if (gtypeExpr !== undefined) {\n members.push(renderInterfaceHasInstance(context, className, gtypeExpr));\n }\n\n members.push(...renderStaticHead(context, callables, className), renderInterfaceBrand(context, implRef));\n\n return `${getDoc(iface)}${renderBracedOrEmpty(\n `export abstract class ${className}`,\n members.join(\"\\n\\n\"),\n )}`;\n};\n\nconst renderInterfaceBrand = (context: ModuleContext, implRef: string): string => {\n context.addRuntimeTypeImport(\"Interface\");\n\n return `${renderJsDoc(undefined, BRAND_NOTE)}declare static __impl__: Interface<${implRef}>[\"__impl__\"];`;\n};\n\nconst renderInterfaceHasInstance = (context: ModuleContext, className: string, gtypeExpr: string): string => {\n context.addRuntimeImport(\"valueIsA\");\n\n return renderBlock(\n `static [Symbol.hasInstance](value: unknown): value is ${className}`,\n `return valueIsA(value, ${gtypeExpr});`,\n );\n};\n\nconst renderInterfaceMaker = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string => {\n context.addRuntimeTypeImport(\"Mixin\");\n const members = renderInterfaceInstanceMembers(context, iface, callables);\n const classExpression = renderBracedOrEmpty(\"class extends Base\", members.join(\"\\n\\n\"));\n\n return `${getDoc(iface)}export const ${makerName(className)}: Mixin = (Base) =>\\n${classExpression};`;\n};\n\nconst renderInterfaceInstanceMembers = (context: ModuleContext, iface: GirClass, callables: Callables): string[] => [\n ...renderInterfaceMembers(context, iface, callables, {\n renderMethod: renderClassInstanceMember,\n renderProperty: renderPropertyAccessor,\n }),\n ...interfaceVfuncMembers(context, iface, \"implementation\"),\n ...renderSignalMembers(context, iface),\n];\n\nexport { generateInterface };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-comparators.d.ts","sourceRoot":"","sources":["../../../src/store/gi/item-comparators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"item-comparators.d.ts","sourceRoot":"","sources":["../../../src/store/gi/item-comparators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAoF7D,QAAA,MAAM,4BAA4B,GAC9B,SAAS,aAAa,EACtB,IAAI,WAAW,EACf,WAAW,YAAY,KACxB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAiBxB,CAAC;AAEF,QAAA,MAAM,oBAAoB,GACtB,SAAS,aAAa,EACtB,IAAI,WAAW,EACf,WAAW,YAAY,KACxB,MAAM,GAAG,SAmBX,CAAC;AAEF,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tObject } from "../../analysis/descriptor.js";
|
|
2
2
|
import { inputParameters, parameterIdentifier } from "../../analysis/param-structure.js";
|
|
3
3
|
import { renderTsType } from "../../analysis/ts-type.js";
|
|
4
|
-
import {
|
|
4
|
+
import { resolveInterfaces } from "../../gir/ancestry.js";
|
|
5
5
|
import { callbackAsFunction } from "../../gir/callback.js";
|
|
6
6
|
const COMPARATOR_CALLBACK_TYPES = new Set([
|
|
7
7
|
"GLib.CompareFunc",
|
|
@@ -19,10 +19,8 @@ const isListModelImplementor = (context, ref) => {
|
|
|
19
19
|
if (resolved?.kind !== "class") {
|
|
20
20
|
return false;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return iface?.namespaceName === "Gio" && iface.klass.name === "ListModel";
|
|
25
|
-
});
|
|
22
|
+
const interfaces = resolveInterfaces(context.library, resolved.namespace.name, resolved.value.implements);
|
|
23
|
+
return interfaces.some((iface) => iface.namespaceName === "Gio" && iface.klass.name === "ListModel");
|
|
26
24
|
};
|
|
27
25
|
const isObjectItemComparator = (context, fn) => {
|
|
28
26
|
const ownerRef = fn.instance?.type ?? fn.returnValue.type;
|
|
@@ -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,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,
|
|
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,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAoB,MAAM,uBAAuB,CAAC;AAE7E,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IACtC,kBAAkB;IAClB,sBAAsB;IACtB,gBAAgB;IAChB,oBAAoB;CACvB,CAAC,CAAC;AAEH,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAEpE,MAAM,aAAa,GAAG,CAAC,OAAsB,EAAE,GAAW,EAAsB,EAAE;IAC9E,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1C,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;AACrF,CAAC,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAAC,OAAsB,EAAE,GAAW,EAAW,EAAE;IAC5E,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,O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AAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,UAAU,EAAE,CAAC;IAEvD,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;AAC9D,CAAC,CAAC;AAEF,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,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;
|
|
@@ -10,6 +12,7 @@ type CallArgPlan = {
|
|
|
10
12
|
};
|
|
11
13
|
declare const methodExportName: (fn: GirFunction) => string;
|
|
12
14
|
declare const renderMethodSignature: (context: ModuleContext, fn: GirFunction) => string;
|
|
15
|
+
declare const returnedOutParameters: (context: ModuleContext, fn: GirFunction) => InputParameter[];
|
|
13
16
|
declare const renderMethodReturnType: (context: ModuleContext, fn: GirFunction) => string;
|
|
14
17
|
declare const renderPromisifiedBody: (context: ModuleContext, asyncFn: GirFunction, finishExpression: string, bindingExpression: string) => string;
|
|
15
18
|
declare const finishCallExpression: (asyncFn: GirFunction, finishFn: GirFunction, ownerName: string) => string;
|
|
@@ -17,8 +20,13 @@ declare const renderPromisifiedSignature: (context: ModuleContext, asyncFn: GirF
|
|
|
17
20
|
signature: string;
|
|
18
21
|
returnType: string;
|
|
19
22
|
};
|
|
23
|
+
declare const isCallbackParameter: (context: ModuleContext, parameter: GirParameter) => boolean;
|
|
20
24
|
declare const renderMethodBody: (context: ModuleContext, fn: GirFunction, options: WriteMethodBodyOptions) => string;
|
|
21
25
|
declare const renderReturnDescriptor: (context: ModuleContext, fn: GirFunction) => string;
|
|
22
26
|
declare const planCallArgs: (context: ModuleContext, fn: GirFunction) => CallArgPlan[];
|
|
23
|
-
|
|
27
|
+
declare const constructibleName: (context: ModuleContext, ref: GirParameter["type"]) => {
|
|
28
|
+
namespaceName: string;
|
|
29
|
+
typeName: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
export { constructibleName, isCallbackParameter, methodExportName, renderMethodSignature, renderMethodReturnType, returnedOutParameters, renderPromisifiedBody, finishCallExpression, renderPromisifiedSignature, renderMethodBody, renderReturnDescriptor, planCallArgs, };
|
|
24
32
|
//# 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;
|
|
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;AAO7D,OAAO,EAMH,KAAK,cAAc,EAGtB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,KAAK,YAAY,EAA0D,MAAM,wBAAwB,CAAC;AAyBnH,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;AAsBF,QAAA,MAAM,gBAAgB,GAAI,IAAI,WAAW,KAAG,MAA4B,CAAC;AAQzE,QAAA,MAAM,qBAAqB,GAAI,SAAS,aAAa,EAAE,IAAI,WAAW,KAAG,MAInE,CAAC;AA2DP,QAAA,MAAM,qBAAqB,GAAI,SAAS,aAAa,EAAE,IAAI,WAAW,KAAG,cAAc,EAWtF,CAAC;AAEF,QAAA,MAAM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LengthSources, closureAndDestroyIndices, emittedArgIndices, folded
|
|
|
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
|
+
import { isClosureType, isCollectibleCallerOut, isHandlePassedInPlace, isHandlePassing } from "./param-marshal.js";
|
|
9
10
|
const methodExportName = (fn) => camelCase(fn.name);
|
|
10
11
|
const arrayLengthArgument = (source, sourceIndex) => {
|
|
11
12
|
const identifier = parameterIdentifier(source, sourceIndex);
|
|
12
13
|
return source.nullable || source.optional ? `(${identifier}?.length ?? 0)` : `${identifier}.length`;
|
|
13
14
|
};
|
|
14
|
-
const renderMethodSignature = (context, fn) => renderInputParameters(context, fn,
|
|
15
|
-
|
|
15
|
+
const renderMethodSignature = (context, fn) => renderInputParameters(context, fn, {
|
|
16
|
+
shouldSkip: () => false,
|
|
17
|
+
isOptionalExtra: () => false,
|
|
18
|
+
});
|
|
19
|
+
const closureAnnotation = (context, base) => {
|
|
20
|
+
context.addRuntimeTypeImport("ClosureCallback");
|
|
21
|
+
return `${base} | ClosureCallback`;
|
|
22
|
+
};
|
|
23
|
+
const requiresClosureMarshal = (context, fn, ref) => isClosureType(context, ref) && areClosuresInvoked(fn);
|
|
24
|
+
const requiresClosureAnnotation = (context, fn, parameter) => parameter.type !== undefined && requiresClosureMarshal(context, fn, parameter.type);
|
|
25
|
+
const parameterAnnotation = (context, fn, parameter) => {
|
|
26
|
+
const comparator = itemComparatorTsType(context, fn, parameter);
|
|
27
|
+
if (comparator !== undefined) {
|
|
28
|
+
return comparator;
|
|
29
|
+
}
|
|
30
|
+
const base = renderTsType(context, parameter.type, parameter.nullable);
|
|
31
|
+
return requiresClosureAnnotation(context, fn, parameter) ? closureAnnotation(context, base) : base;
|
|
32
|
+
};
|
|
16
33
|
const isParameterOptional = (parameter, isOptionalExtra) => parameter.optional || isOptionalExtra(parameter);
|
|
17
34
|
const formatParameterPart = (name, annotation, isOptional) => isOptional ? `${name}?: ${annotation}` : `${name}: ${annotation}`;
|
|
18
|
-
const renderInputParameters = (context, fn,
|
|
35
|
+
const renderInputParameters = (context, fn, options) => {
|
|
19
36
|
const parts = [];
|
|
20
|
-
let
|
|
37
|
+
let hasSeenOptional = false;
|
|
21
38
|
for (const { parameter, index } of inputParameters(context.library, fn)) {
|
|
22
|
-
if (shouldSkip(parameter)) {
|
|
39
|
+
if (options.shouldSkip(parameter)) {
|
|
23
40
|
continue;
|
|
24
41
|
}
|
|
25
42
|
const name = parameterIdentifier(parameter, index);
|
|
26
|
-
if (isParameterOptional(parameter, isOptionalExtra)) {
|
|
27
|
-
|
|
43
|
+
if (isParameterOptional(parameter, options.isOptionalExtra)) {
|
|
44
|
+
hasSeenOptional = true;
|
|
28
45
|
}
|
|
29
|
-
|
|
46
|
+
const annotation = parameterAnnotation(context, fn, parameter);
|
|
47
|
+
parts.push(formatParameterPart(name, annotation, hasSeenOptional));
|
|
30
48
|
}
|
|
31
49
|
return parts.join(", ");
|
|
32
50
|
};
|
|
33
51
|
const isReturnedOutParameter = (context, parameter) => isOutParameter(parameter) ||
|
|
34
52
|
(isCallerAllocatedOut(parameter) && isCollectibleCallerOut(context, parameter)) ||
|
|
35
53
|
isInoutParameter(parameter);
|
|
36
|
-
const
|
|
54
|
+
const returnedOutParameters = (context, fn) => {
|
|
37
55
|
const folded = foldedLengthIndices(context.library, fn);
|
|
38
|
-
const
|
|
56
|
+
const result = [];
|
|
57
|
+
for (const [index, parameter] of fn.parameters.entries()) {
|
|
58
|
+
if (isReturnedOutParameter(context, parameter) && !folded.has(index)) {
|
|
59
|
+
result.push({ parameter, index });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
const renderMethodReturnType = (context, fn) => {
|
|
65
|
+
const outs = returnedOutParameters(context, fn);
|
|
39
66
|
const primary = shouldOmitPrimaryReturn(context.library, fn.returnValue)
|
|
40
67
|
? undefined
|
|
41
68
|
: renderTsType(context, fn.returnValue.type, fn.returnValue.nullable);
|
|
42
69
|
if (outs.length === 0) {
|
|
43
70
|
return primary ?? "void";
|
|
44
71
|
}
|
|
45
|
-
const outTypes = outs.map((parameter) => renderTsType(context, parameter.type, parameter.nullable));
|
|
72
|
+
const outTypes = outs.map(({ parameter }) => renderTsType(context, parameter.type, parameter.nullable));
|
|
46
73
|
return foldOutParamShape(primary, outTypes);
|
|
47
74
|
};
|
|
48
75
|
const classifyPromisifiedParameter = (promisify, parameter, index, state) => {
|
|
49
76
|
if (parameter.isVarargs) {
|
|
50
|
-
return {
|
|
77
|
+
return { hasSeenOptional: state.hasSeenOptional, expression: undefined };
|
|
51
78
|
}
|
|
52
79
|
if (index === state.cancellableIndex) {
|
|
53
|
-
return {
|
|
80
|
+
return { hasSeenOptional: true, expression: undefined };
|
|
54
81
|
}
|
|
55
82
|
if (shouldSkipPromisifiedParameter(promisify, parameter, index)) {
|
|
56
|
-
return {
|
|
83
|
+
return { hasSeenOptional: state.hasSeenOptional, expression: undefined };
|
|
57
84
|
}
|
|
58
|
-
const
|
|
59
|
-
return {
|
|
85
|
+
const hasSeenOptional = state.hasSeenOptional || parameter.optional;
|
|
86
|
+
return { hasSeenOptional, expression: promisifiedArgument(promisify, parameter, index, hasSeenOptional) };
|
|
60
87
|
};
|
|
61
88
|
const collectPromisifiedArguments = (promisify, cancellableIndex) => {
|
|
62
89
|
const expressions = [];
|
|
63
|
-
let
|
|
90
|
+
let hasSeenOptional = false;
|
|
64
91
|
for (const [index, parameter] of promisify.asyncFn.parameters.entries()) {
|
|
65
92
|
const step = classifyPromisifiedParameter(promisify, parameter, index, {
|
|
66
93
|
cancellableIndex,
|
|
67
|
-
|
|
94
|
+
hasSeenOptional,
|
|
68
95
|
});
|
|
69
|
-
|
|
96
|
+
hasSeenOptional = step.hasSeenOptional;
|
|
70
97
|
if (step.expression !== undefined) {
|
|
71
98
|
expressions.push(step.expression);
|
|
72
99
|
}
|
|
@@ -112,11 +139,14 @@ const promisifiedArgument = (promisify, parameter, index, hasSeenOptional) => {
|
|
|
112
139
|
if (sourceIndex !== undefined && source !== undefined) {
|
|
113
140
|
return arrayLengthArgument(source, sourceIndex);
|
|
114
141
|
}
|
|
115
|
-
return parameterCallExpression(context, parameter, index, hasSeenOptional);
|
|
142
|
+
return parameterCallExpression(context, parameter, index, { fn: asyncFn, isForcedNullable: hasSeenOptional });
|
|
116
143
|
};
|
|
117
144
|
const findCancellableIndex = (context, parameters) => parameters.findIndex((parameter) => isCancellable(context, parameter));
|
|
118
145
|
const renderPromisifiedSignature = (context, asyncFn, finishFn) => {
|
|
119
|
-
const signature = renderInputParameters(context, asyncFn,
|
|
146
|
+
const signature = renderInputParameters(context, asyncFn, {
|
|
147
|
+
shouldSkip: (parameter) => isCallbackParameter(context, parameter),
|
|
148
|
+
isOptionalExtra: (parameter) => isCancellable(context, parameter),
|
|
149
|
+
});
|
|
120
150
|
const finishReturn = renderMethodReturnType(context, finishFn);
|
|
121
151
|
return { signature, returnType: `Promise<${finishReturn}>` };
|
|
122
152
|
};
|
|
@@ -142,11 +172,11 @@ const paramDescriptorLiteral = (descriptor, options) => {
|
|
|
142
172
|
if (options.direction !== undefined) {
|
|
143
173
|
parts.push(`direction: ${sourceStringLiteral(options.direction)}`);
|
|
144
174
|
}
|
|
145
|
-
if (options.
|
|
146
|
-
parts.push("
|
|
175
|
+
if (options.isCallerAllocated === true) {
|
|
176
|
+
parts.push("isCallerAllocated: true");
|
|
147
177
|
}
|
|
148
|
-
if (options.
|
|
149
|
-
parts.push("
|
|
178
|
+
if (options.isConsumed === true) {
|
|
179
|
+
parts.push("isConsumed: true");
|
|
150
180
|
}
|
|
151
181
|
return `{ ${parts.join(", ")} }`;
|
|
152
182
|
};
|
|
@@ -213,9 +243,10 @@ const planInoutArgument = (context, parameter, index, planContext) => {
|
|
|
213
243
|
? { source: lengthSourceParam, index: lengthSourceIndex }
|
|
214
244
|
: undefined;
|
|
215
245
|
return planInoutParam(context, parameter, {
|
|
246
|
+
fn,
|
|
216
247
|
index,
|
|
217
248
|
argIndex: planContext.argIndex,
|
|
218
|
-
|
|
249
|
+
isConsumed: folded.has(index),
|
|
219
250
|
lengthSource,
|
|
220
251
|
});
|
|
221
252
|
};
|
|
@@ -228,9 +259,12 @@ const planLengthArgument = (context, parameter, sourceIndex, planContext) => {
|
|
|
228
259
|
};
|
|
229
260
|
};
|
|
230
261
|
const planOutParam = (context, parameter, argIndex, isConsumed) => {
|
|
231
|
-
const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership,
|
|
262
|
+
const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, {
|
|
263
|
+
...argIndex,
|
|
264
|
+
hasOutIndirection: true,
|
|
265
|
+
});
|
|
232
266
|
return {
|
|
233
|
-
paramLiteral: paramDescriptorLiteral(descriptor, { direction: "out",
|
|
267
|
+
paramLiteral: paramDescriptorLiteral(descriptor, { direction: "out", isConsumed }),
|
|
234
268
|
inputExpr: undefined,
|
|
235
269
|
};
|
|
236
270
|
};
|
|
@@ -253,26 +287,33 @@ const planCallerOut = (context, parameter, argIndex) => {
|
|
|
253
287
|
context.addRuntimeImport("getHandle");
|
|
254
288
|
const classExpression = context.qualify(name.namespaceName, name.typeName);
|
|
255
289
|
return {
|
|
256
|
-
paramLiteral: paramDescriptorLiteral(descriptor, { direction: "out",
|
|
290
|
+
paramLiteral: paramDescriptorLiteral(descriptor, { direction: "out", isCallerAllocated: true }),
|
|
257
291
|
inputExpr: `new ${classExpression}()`,
|
|
258
292
|
};
|
|
259
293
|
}
|
|
260
294
|
return { paramLiteral: paramDescriptorLiteral(descriptor, {}), inputExpr: "undefined" };
|
|
261
295
|
};
|
|
262
296
|
const planInoutParam = (context, parameter, options) => {
|
|
263
|
-
const { index, argIndex,
|
|
297
|
+
const { fn, index, argIndex, isConsumed, lengthSource } = options;
|
|
264
298
|
if (isHandlePassedInPlace(context, parameter)) {
|
|
265
299
|
const descriptor = renderDescriptor(context, parameter.type, "none", argIndex);
|
|
266
300
|
return {
|
|
267
|
-
paramLiteral: paramDescriptorLiteral(descriptor, {
|
|
301
|
+
paramLiteral: paramDescriptorLiteral(descriptor, {
|
|
302
|
+
direction: "inout",
|
|
303
|
+
isCallerAllocated: true,
|
|
304
|
+
isConsumed,
|
|
305
|
+
}),
|
|
268
306
|
inputExpr: parameterIdentifier(parameter, index),
|
|
269
307
|
};
|
|
270
308
|
}
|
|
271
|
-
const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership,
|
|
309
|
+
const descriptor = renderDescriptor(context, parameter.type, parameter.transferOwnership, {
|
|
310
|
+
...argIndex,
|
|
311
|
+
hasOutIndirection: true,
|
|
312
|
+
});
|
|
272
313
|
return {
|
|
273
|
-
paramLiteral: paramDescriptorLiteral(descriptor, { direction: "inout",
|
|
314
|
+
paramLiteral: paramDescriptorLiteral(descriptor, { direction: "inout", isConsumed }),
|
|
274
315
|
inputExpr: lengthSource === undefined
|
|
275
|
-
? parameterCallExpression(context, parameter, index)
|
|
316
|
+
? parameterCallExpression(context, parameter, index, { fn })
|
|
276
317
|
: arrayLengthArgument(lengthSource.source, lengthSource.index),
|
|
277
318
|
};
|
|
278
319
|
};
|
|
@@ -283,21 +324,23 @@ const planInParam = (context, parameter, index, planContext) => {
|
|
|
283
324
|
renderDescriptor(context, parameter.type, parameter.transferOwnership, planContext.argIndex);
|
|
284
325
|
return {
|
|
285
326
|
paramLiteral: paramDescriptorLiteral(descriptor, {}),
|
|
286
|
-
inputExpr: parameterCallExpression(context, parameter, index),
|
|
327
|
+
inputExpr: parameterCallExpression(context, parameter, index, { fn }),
|
|
287
328
|
};
|
|
288
329
|
};
|
|
330
|
+
const nullableHandleExpression = (name) => `${name} == null ? null : getHandle(${name})`;
|
|
289
331
|
const handleArgument = (context, name, isNullable) => {
|
|
290
|
-
if (isNullable) {
|
|
291
|
-
context.addRuntimeImport("tryGetHandle");
|
|
292
|
-
return `tryGetHandle(${name})`;
|
|
293
|
-
}
|
|
294
332
|
context.addRuntimeImport("getHandle");
|
|
295
|
-
return `getHandle(${name})`;
|
|
333
|
+
return isNullable ? nullableHandleExpression(name) : `getHandle(${name})`;
|
|
334
|
+
};
|
|
335
|
+
const closureArgument = (context, name, isNullable) => {
|
|
336
|
+
const helper = isNullable ? "tryToClosure" : "toClosure";
|
|
337
|
+
context.addRuntimeImport(helper);
|
|
338
|
+
return `${helper}(${name})`;
|
|
296
339
|
};
|
|
297
340
|
const hashtableArgument = (context, valueRef, name) => {
|
|
298
341
|
if (isHandlePassing(context, valueRef)) {
|
|
299
|
-
context.addRuntimeImport("
|
|
300
|
-
return `${name} ? globalThis.Array.from(${name}).map(([k, v]) => [k,
|
|
342
|
+
context.addRuntimeImport("getHandle");
|
|
343
|
+
return `${name} ? globalThis.Array.from(${name}).map(([k, v]) => [k, ${nullableHandleExpression("v")}]) : null`;
|
|
301
344
|
}
|
|
302
345
|
return `${name} ? globalThis.Array.from(${name}) : null`;
|
|
303
346
|
};
|
|
@@ -312,26 +355,28 @@ const collectionArgument = (context, type, name, isNullable) => {
|
|
|
312
355
|
context.addRuntimeImport("getHandle");
|
|
313
356
|
return mapHandleExpression(name, isNullable);
|
|
314
357
|
};
|
|
315
|
-
// An array whose length nothing states is marshalled as the bare pointer it is, so there is nothing
|
|
316
|
-
// to map over.
|
|
317
358
|
const isMappableSequence = (context, type) => {
|
|
318
359
|
if (type?.kind === "carray") {
|
|
319
360
|
return !hasUnknownArrayLength(type) && isHandlePassing(context, type.element);
|
|
320
361
|
}
|
|
321
362
|
return type?.kind === "list" && isHandlePassing(context, type.element);
|
|
322
363
|
};
|
|
323
|
-
const parameterCallExpression = (context, parameter, index,
|
|
364
|
+
const parameterCallExpression = (context, parameter, index, options) => {
|
|
365
|
+
const { fn, isForcedNullable = false } = options;
|
|
324
366
|
const name = parameterIdentifier(parameter, index);
|
|
325
367
|
const ref = parameter.type;
|
|
326
368
|
if (ref === undefined) {
|
|
327
369
|
return name;
|
|
328
370
|
}
|
|
329
371
|
const isNullable = parameter.nullable || parameter.optional || isForcedNullable;
|
|
372
|
+
if (requiresClosureMarshal(context, fn, ref)) {
|
|
373
|
+
return closureArgument(context, name, isNullable);
|
|
374
|
+
}
|
|
330
375
|
if (isHandlePassing(context, ref)) {
|
|
331
376
|
return handleArgument(context, name, isNullable);
|
|
332
377
|
}
|
|
333
378
|
const type = context.library.typeFor(ref);
|
|
334
379
|
return collectionArgument(context, type, name, isNullable) ?? name;
|
|
335
380
|
};
|
|
336
|
-
export { methodExportName, renderMethodSignature, renderMethodReturnType, renderPromisifiedBody, finishCallExpression, renderPromisifiedSignature, renderMethodBody, renderReturnDescriptor, planCallArgs, };
|
|
381
|
+
export { constructibleName, isCallbackParameter, methodExportName, renderMethodSignature, renderMethodReturnType, returnedOutParameters, renderPromisifiedBody, finishCallExpression, renderPromisifiedSignature, renderMethodBody, renderReturnDescriptor, planCallArgs, };
|
|
337
382
|
//# sourceMappingURL=method.js.map
|