@gtkx/codegen 0.21.0 → 1.0.0-rc.1
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 +173 -0
- package/dist/analysis/descriptor-render.d.ts +18 -0
- package/dist/analysis/descriptor-render.d.ts.map +1 -0
- package/dist/analysis/descriptor-render.js +297 -0
- package/dist/analysis/descriptor-render.js.map +1 -0
- package/dist/analysis/descriptor.d.ts +59 -0
- package/dist/analysis/descriptor.d.ts.map +1 -0
- package/dist/analysis/descriptor.js +123 -0
- package/dist/analysis/descriptor.js.map +1 -0
- package/dist/analysis/inheritance.d.ts +38 -0
- package/dist/analysis/inheritance.d.ts.map +1 -0
- package/dist/analysis/inheritance.js +193 -0
- package/dist/analysis/inheritance.js.map +1 -0
- package/dist/analysis/param-structure.d.ts +26 -0
- package/dist/analysis/param-structure.d.ts.map +1 -0
- package/dist/analysis/param-structure.js +107 -0
- package/dist/analysis/param-structure.js.map +1 -0
- package/dist/analysis/ts-type.d.ts +19 -0
- package/dist/analysis/ts-type.d.ts.map +1 -0
- package/dist/analysis/ts-type.js +65 -0
- package/dist/analysis/ts-type.js.map +1 -0
- package/dist/compile.d.ts +18 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +123 -0
- package/dist/compile.js.map +1 -0
- package/dist/docs/api-reference.d.ts +66 -0
- package/dist/docs/api-reference.d.ts.map +1 -0
- package/dist/docs/api-reference.js +299 -0
- package/dist/docs/api-reference.js.map +1 -0
- package/dist/docs/element-page.d.ts +15 -0
- package/dist/docs/element-page.d.ts.map +1 -0
- package/dist/docs/element-page.js +221 -0
- package/dist/docs/element-page.js.map +1 -0
- package/dist/docs/pipeline.d.ts +25 -0
- package/dist/docs/pipeline.d.ts.map +1 -0
- package/dist/docs/pipeline.js +130 -0
- package/dist/docs/pipeline.js.map +1 -0
- package/dist/docs/render.d.ts +32 -0
- package/dist/docs/render.d.ts.map +1 -0
- package/dist/docs/render.js +134 -0
- package/dist/docs/render.js.map +1 -0
- package/dist/docs/symbol-page.d.ts +41 -0
- package/dist/docs/symbol-page.d.ts.map +1 -0
- package/dist/docs/symbol-page.js +338 -0
- package/dist/docs/symbol-page.js.map +1 -0
- package/dist/fingerprint.d.ts +6 -26
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +30 -18
- package/dist/fingerprint.js.map +1 -1
- package/dist/gir/ancestry.d.ts +9 -0
- package/dist/gir/ancestry.d.ts.map +1 -0
- package/dist/gir/ancestry.js +29 -0
- package/dist/gir/ancestry.js.map +1 -0
- package/dist/gir/callback.d.ts +9 -10
- package/dist/gir/callback.d.ts.map +1 -1
- package/dist/gir/callback.js +17 -16
- package/dist/gir/callback.js.map +1 -1
- package/dist/gir/class.d.ts +22 -43
- package/dist/gir/class.d.ts.map +1 -1
- package/dist/gir/class.js +11 -23
- package/dist/gir/class.js.map +1 -1
- package/dist/gir/enum.d.ts +13 -31
- package/dist/gir/enum.d.ts.map +1 -1
- package/dist/gir/enum.js +7 -14
- package/dist/gir/enum.js.map +1 -1
- package/dist/gir/field.d.ts +10 -23
- package/dist/gir/field.d.ts.map +1 -1
- package/dist/gir/field.js +12 -18
- package/dist/gir/field.js.map +1 -1
- package/dist/gir/function.d.ts +11 -42
- package/dist/gir/function.d.ts.map +1 -1
- package/dist/gir/function.js +7 -20
- package/dist/gir/function.js.map +1 -1
- package/dist/gir/gir-path.d.ts +2 -0
- package/dist/gir/gir-path.d.ts.map +1 -0
- package/dist/gir/gir-path.js +41 -0
- package/dist/gir/gir-path.js.map +1 -0
- package/dist/gir/libraries.d.ts +4 -0
- package/dist/gir/libraries.d.ts.map +1 -0
- package/dist/gir/libraries.js +62 -0
- package/dist/gir/libraries.js.map +1 -0
- package/dist/gir/library.d.ts +37 -0
- package/dist/gir/library.d.ts.map +1 -0
- package/dist/gir/library.js +218 -0
- package/dist/gir/library.js.map +1 -0
- package/dist/gir/namespace.d.ts +36 -50
- package/dist/gir/namespace.d.ts.map +1 -1
- package/dist/gir/namespace.js +46 -36
- package/dist/gir/namespace.js.map +1 -1
- package/dist/gir/parameter.d.ts +25 -69
- package/dist/gir/parameter.d.ts.map +1 -1
- package/dist/gir/parameter.js +36 -57
- package/dist/gir/parameter.js.map +1 -1
- package/dist/gir/parse.d.ts +6 -70
- package/dist/gir/parse.d.ts.map +1 -1
- package/dist/gir/parse.js +32 -80
- package/dist/gir/parse.js.map +1 -1
- package/dist/gir/primitives.d.ts +3 -34
- package/dist/gir/primitives.d.ts.map +1 -1
- package/dist/gir/primitives.js +19 -35
- package/dist/gir/primitives.js.map +1 -1
- package/dist/gir/property.d.ts +16 -25
- package/dist/gir/property.d.ts.map +1 -1
- package/dist/gir/property.js +12 -9
- package/dist/gir/property.js.map +1 -1
- package/dist/gir/record.d.ts +27 -0
- package/dist/gir/record.d.ts.map +1 -0
- package/dist/gir/record.js +25 -0
- package/dist/gir/record.js.map +1 -0
- package/dist/gir/size.d.ts +10 -57
- package/dist/gir/size.d.ts.map +1 -1
- package/dist/gir/size.js +0 -25
- package/dist/gir/size.js.map +1 -1
- package/dist/gir/type-id.d.ts +49 -0
- package/dist/gir/type-id.d.ts.map +1 -0
- package/dist/gir/type-id.js +8 -0
- package/dist/gir/type-id.js.map +1 -0
- package/dist/gir/type-ref.d.ts +3 -77
- package/dist/gir/type-ref.d.ts.map +1 -1
- package/dist/gir/type-ref.js +35 -65
- package/dist/gir/type-ref.js.map +1 -1
- package/dist/gir/type.d.ts +33 -0
- package/dist/gir/type.d.ts.map +1 -0
- package/dist/gir/type.js +2 -0
- package/dist/gir/type.js.map +1 -0
- package/dist/index.d.ts +5 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -11
- package/dist/index.js.map +1 -1
- package/dist/khronos/args.d.ts +30 -0
- package/dist/khronos/args.d.ts.map +1 -0
- package/dist/khronos/args.js +150 -0
- package/dist/khronos/args.js.map +1 -0
- package/dist/khronos/jsdoc.d.ts +21 -0
- package/dist/khronos/jsdoc.d.ts.map +1 -0
- package/dist/khronos/jsdoc.js +59 -0
- package/dist/khronos/jsdoc.js.map +1 -0
- package/dist/khronos/model.d.ts +37 -0
- package/dist/khronos/model.d.ts.map +1 -0
- package/dist/khronos/model.js +132 -0
- package/dist/khronos/model.js.map +1 -0
- package/dist/khronos/modules.d.ts +11 -0
- package/dist/khronos/modules.d.ts.map +1 -0
- package/dist/khronos/modules.js +58 -0
- package/dist/khronos/modules.js.map +1 -0
- package/dist/khronos/parse.d.ts +9 -0
- package/dist/khronos/parse.d.ts.map +1 -0
- package/dist/khronos/parse.js +61 -0
- package/dist/khronos/parse.js.map +1 -0
- package/dist/khronos/pipeline.d.ts +24 -0
- package/dist/khronos/pipeline.d.ts.map +1 -0
- package/dist/khronos/pipeline.js +182 -0
- package/dist/khronos/pipeline.js.map +1 -0
- package/dist/khronos/plan.d.ts +80 -0
- package/dist/khronos/plan.d.ts.map +1 -0
- package/dist/khronos/plan.js +136 -0
- package/dist/khronos/plan.js.map +1 -0
- package/dist/khronos/render.d.ts +16 -0
- package/dist/khronos/render.d.ts.map +1 -0
- package/dist/khronos/render.js +158 -0
- package/dist/khronos/render.js.map +1 -0
- package/dist/khronos/select.d.ts +15 -0
- package/dist/khronos/select.d.ts.map +1 -0
- package/dist/khronos/select.js +45 -0
- package/dist/khronos/select.js.map +1 -0
- package/dist/runner.d.ts +29 -47
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +78 -53
- package/dist/runner.js.map +1 -1
- package/dist/store/compile-store.d.ts +9 -0
- package/dist/store/compile-store.d.ts.map +1 -0
- package/dist/store/compile-store.js +38 -0
- package/dist/store/compile-store.js.map +1 -0
- package/dist/store/gi/async.d.ts +4 -0
- package/dist/store/gi/async.d.ts.map +1 -0
- package/dist/store/gi/async.js +41 -0
- package/dist/store/gi/async.js.map +1 -0
- package/dist/store/gi/callables.d.ts +36 -0
- package/dist/store/gi/callables.d.ts.map +1 -0
- package/dist/store/gi/callables.js +202 -0
- package/dist/store/gi/callables.js.map +1 -0
- package/dist/store/gi/callback.d.ts +4 -0
- package/dist/store/gi/callback.d.ts.map +1 -0
- package/dist/store/gi/callback.js +14 -0
- package/dist/store/gi/callback.js.map +1 -0
- package/dist/store/gi/class-struct-record.d.ts +9 -0
- package/dist/store/gi/class-struct-record.d.ts.map +1 -0
- package/dist/store/gi/class-struct-record.js +34 -0
- package/dist/store/gi/class-struct-record.js.map +1 -0
- package/dist/store/gi/class.d.ts +4 -0
- package/dist/store/gi/class.d.ts.map +1 -0
- package/dist/store/gi/class.js +169 -0
- package/dist/store/gi/class.js.map +1 -0
- package/dist/store/gi/companion.d.ts +4 -0
- package/dist/store/gi/companion.d.ts.map +1 -0
- package/dist/store/gi/companion.js +13 -0
- package/dist/store/gi/companion.js.map +1 -0
- package/dist/store/gi/constant.d.ts +5 -0
- package/dist/store/gi/constant.d.ts.map +1 -0
- package/dist/store/gi/constant.js +18 -0
- package/dist/store/gi/constant.js.map +1 -0
- package/dist/store/gi/constructor-props.d.ts +5 -0
- package/dist/store/gi/constructor-props.d.ts.map +1 -0
- package/dist/store/gi/constructor-props.js +64 -0
- package/dist/store/gi/constructor-props.js.map +1 -0
- package/dist/store/gi/enum.d.ts +5 -0
- package/dist/store/gi/enum.d.ts.map +1 -0
- package/dist/store/gi/enum.js +38 -0
- package/dist/store/gi/enum.js.map +1 -0
- package/dist/store/gi/function.d.ts +8 -0
- package/dist/store/gi/function.d.ts.map +1 -0
- package/dist/store/gi/function.js +87 -0
- package/dist/store/gi/function.js.map +1 -0
- package/dist/store/gi/gtype-binding.d.ts +10 -0
- package/dist/store/gi/gtype-binding.d.ts.map +1 -0
- package/dist/store/gi/gtype-binding.js +20 -0
- package/dist/store/gi/gtype-binding.js.map +1 -0
- package/dist/store/gi/interface.d.ts +4 -0
- package/dist/store/gi/interface.d.ts.map +1 -0
- package/dist/store/gi/interface.js +99 -0
- package/dist/store/gi/interface.js.map +1 -0
- package/dist/store/gi/item-comparators.d.ts +6 -0
- package/dist/store/gi/item-comparators.d.ts.map +1 -0
- package/dist/store/gi/item-comparators.js +76 -0
- package/dist/store/gi/item-comparators.js.map +1 -0
- package/dist/store/gi/method.d.ts +24 -0
- package/dist/store/gi/method.d.ts.map +1 -0
- package/dist/store/gi/method.js +279 -0
- package/dist/store/gi/method.js.map +1 -0
- package/dist/store/gi/param-marshal.d.ts +9 -0
- package/dist/store/gi/param-marshal.d.ts.map +1 -0
- package/dist/store/gi/param-marshal.js +37 -0
- package/dist/store/gi/param-marshal.js.map +1 -0
- package/dist/store/gi/pipeline.d.ts +4 -0
- package/dist/store/gi/pipeline.d.ts.map +1 -0
- package/dist/store/gi/pipeline.js +80 -0
- package/dist/store/gi/pipeline.js.map +1 -0
- package/dist/store/gi/properties.d.ts +5 -0
- package/dist/store/gi/properties.d.ts.map +1 -0
- package/dist/store/gi/properties.js +30 -0
- package/dist/store/gi/properties.js.map +1 -0
- package/dist/store/gi/property-accessor.d.ts +26 -0
- package/dist/store/gi/property-accessor.d.ts.map +1 -0
- package/dist/store/gi/property-accessor.js +132 -0
- package/dist/store/gi/property-accessor.js.map +1 -0
- package/dist/store/gi/record-constructor.d.ts +5 -0
- package/dist/store/gi/record-constructor.d.ts.map +1 -0
- package/dist/store/gi/record-constructor.js +65 -0
- package/dist/store/gi/record-constructor.js.map +1 -0
- package/dist/store/gi/record-field-accessor.d.ts +25 -0
- package/dist/store/gi/record-field-accessor.d.ts.map +1 -0
- package/dist/store/gi/record-field-accessor.js +288 -0
- package/dist/store/gi/record-field-accessor.js.map +1 -0
- package/dist/store/gi/record-layout.d.ts +14 -0
- package/dist/store/gi/record-layout.d.ts.map +1 -0
- package/dist/store/gi/record-layout.js +96 -0
- package/dist/store/gi/record-layout.js.map +1 -0
- package/dist/store/gi/record.d.ts +4 -0
- package/dist/store/gi/record.d.ts.map +1 -0
- package/dist/store/gi/record.js +59 -0
- package/dist/store/gi/record.js.map +1 -0
- package/dist/store/gi/registration.d.ts +16 -0
- package/dist/store/gi/registration.d.ts.map +1 -0
- package/dist/store/gi/registration.js +20 -0
- package/dist/store/gi/registration.js.map +1 -0
- package/dist/store/gi/return-wrap.d.ts +10 -0
- package/dist/store/gi/return-wrap.d.ts.map +1 -0
- package/dist/store/gi/return-wrap.js +46 -0
- package/dist/store/gi/return-wrap.js.map +1 -0
- package/dist/store/gi/runtime-override.d.ts +3 -0
- package/dist/store/gi/runtime-override.d.ts.map +1 -0
- package/dist/{writers → store/gi}/runtime-override.js +0 -15
- package/dist/store/gi/runtime-override.js.map +1 -0
- package/dist/store/gi/signal.d.ts +5 -0
- package/dist/store/gi/signal.d.ts.map +1 -0
- package/dist/store/gi/signal.js +233 -0
- package/dist/store/gi/signal.js.map +1 -0
- package/dist/store/gi/vtable.d.ts +4 -0
- package/dist/store/gi/vtable.d.ts.map +1 -0
- package/dist/store/gi/vtable.js +78 -0
- package/dist/store/gi/vtable.js.map +1 -0
- package/dist/store/gi-store.d.ts +9 -0
- package/dist/store/gi-store.d.ts.map +1 -0
- package/dist/store/gi-store.js +57 -0
- package/dist/store/gi-store.js.map +1 -0
- package/dist/store/jsx-store.d.ts +5 -0
- package/dist/store/jsx-store.d.ts.map +1 -0
- package/dist/store/jsx-store.js +23 -0
- package/dist/store/jsx-store.js.map +1 -0
- package/dist/store/react/built-ins.d.ts +9 -0
- package/dist/store/react/built-ins.d.ts.map +1 -0
- package/dist/store/react/built-ins.js +226 -0
- package/dist/store/react/built-ins.js.map +1 -0
- package/dist/store/react/element-components.d.ts +15 -0
- package/dist/store/react/element-components.d.ts.map +1 -0
- package/dist/store/react/element-components.js +92 -0
- package/dist/store/react/element-components.js.map +1 -0
- package/dist/store/react/element-prop-types.d.ts +19 -0
- package/dist/store/react/element-prop-types.d.ts.map +1 -0
- package/dist/store/react/element-prop-types.js +244 -0
- package/dist/store/react/element-prop-types.js.map +1 -0
- package/dist/store/react/element-props.d.ts +4 -0
- package/dist/store/react/element-props.d.ts.map +1 -0
- package/dist/store/react/element-props.js +178 -0
- package/dist/store/react/element-props.js.map +1 -0
- package/dist/store/react/gir-index.d.ts +25 -0
- package/dist/store/react/gir-index.d.ts.map +1 -0
- package/dist/store/react/gir-index.js +55 -0
- package/dist/store/react/gir-index.js.map +1 -0
- package/dist/store/react/intrinsic-elements.d.ts +26 -0
- package/dist/store/react/intrinsic-elements.d.ts.map +1 -0
- package/dist/store/react/intrinsic-elements.js +107 -0
- package/dist/store/react/intrinsic-elements.js.map +1 -0
- package/dist/store/react/jsx.d.ts +18 -0
- package/dist/store/react/jsx.d.ts.map +1 -0
- package/dist/store/react/jsx.js +203 -0
- package/dist/store/react/jsx.js.map +1 -0
- package/dist/store/react/metadata.d.ts +4 -0
- package/dist/store/react/metadata.d.ts.map +1 -0
- package/dist/store/react/metadata.js +174 -0
- package/dist/store/react/metadata.js.map +1 -0
- package/dist/store/react/pipeline.d.ts +14 -0
- package/dist/store/react/pipeline.d.ts.map +1 -0
- package/dist/store/react/pipeline.js +60 -0
- package/dist/store/react/pipeline.js.map +1 -0
- package/dist/store/react/props.d.ts +36 -0
- package/dist/store/react/props.d.ts.map +1 -0
- package/dist/store/react/props.js +133 -0
- package/dist/store/react/props.js.map +1 -0
- package/dist/store/store-fs.d.ts +41 -0
- package/dist/store/store-fs.d.ts.map +1 -0
- package/dist/store/store-fs.js +71 -0
- package/dist/store/store-fs.js.map +1 -0
- package/dist/writer/context.d.ts +16 -0
- package/dist/writer/context.d.ts.map +1 -0
- package/dist/writer/context.js +44 -0
- package/dist/writer/context.js.map +1 -0
- package/dist/writer/doc.d.ts +2 -0
- package/dist/writer/doc.d.ts.map +1 -0
- package/dist/writer/doc.js +12 -0
- package/dist/writer/doc.js.map +1 -0
- package/dist/writer/emit.d.ts +8 -0
- package/dist/writer/emit.d.ts.map +1 -0
- package/dist/writer/emit.js +21 -0
- package/dist/writer/emit.js.map +1 -0
- package/dist/writer/gtk-doc.d.ts +2 -0
- package/dist/writer/gtk-doc.d.ts.map +1 -0
- package/dist/writer/gtk-doc.js +67 -0
- package/dist/writer/gtk-doc.js.map +1 -0
- package/dist/writer/imports.d.ts +10 -0
- package/dist/writer/imports.d.ts.map +1 -0
- package/dist/writer/imports.js +50 -0
- package/dist/writer/imports.js.map +1 -0
- package/dist/writer/module.d.ts +15 -0
- package/dist/writer/module.d.ts.map +1 -0
- package/dist/writer/module.js +46 -0
- package/dist/writer/module.js.map +1 -0
- package/overrides/cairo/context.ts.ejs +1269 -0
- package/overrides/cairo/font-face.ts.ejs +151 -0
- package/overrides/cairo/font-options.ts.ejs +199 -0
- package/overrides/cairo/image-surface.ts.ejs +132 -0
- package/overrides/cairo/index.ts.ejs +22 -0
- package/overrides/cairo/matrix.ts.ejs +171 -0
- package/overrides/cairo/pattern.ts.ejs +476 -0
- package/overrides/cairo/recording-surface.ts.ejs +102 -0
- package/overrides/cairo/region.ts.ejs +237 -0
- package/overrides/cairo/scaled-font.ts.ejs +330 -0
- package/overrides/cairo/surface.ts.ejs +296 -0
- package/overrides/gdk/index.ts.ejs +2 -0
- package/overrides/gdk/rgba.ts.ejs +11 -0
- package/overrides/gobject/index.ts.ejs +29 -0
- package/overrides/gobject/object.ts.ejs +51 -0
- package/overrides/gobject/value.ts.ejs +17 -0
- package/overrides/graphene/index.ts.ejs +2 -0
- package/overrides/graphene/structs.ts.ejs +37 -0
- package/overrides/gtk/constants.ts.ejs +3 -0
- package/overrides/gtk/index.ts.ejs +2 -0
- package/package.json +15 -15
- package/src/analysis/descriptor-render.ts +407 -0
- package/src/analysis/descriptor.ts +263 -0
- package/src/analysis/inheritance.ts +242 -0
- package/src/analysis/param-structure.ts +127 -0
- package/src/analysis/ts-type.ts +88 -0
- package/src/compile.ts +152 -0
- package/src/docs/api-reference.ts +361 -0
- package/src/docs/element-page.ts +290 -0
- package/src/docs/pipeline.ts +182 -0
- package/src/docs/render.ts +191 -0
- package/src/docs/symbol-page.ts +444 -0
- package/src/fingerprint.ts +40 -29
- package/src/gir/ancestry.ts +41 -0
- package/src/gir/callback.ts +25 -22
- package/src/gir/class.ts +31 -57
- package/src/gir/enum.ts +20 -38
- package/src/gir/field.ts +21 -36
- package/src/gir/function.ts +17 -56
- package/src/gir/gir-path.ts +49 -0
- package/src/gir/libraries.ts +77 -0
- package/src/gir/library.ts +248 -0
- package/src/gir/namespace.ts +85 -80
- package/src/gir/parameter.ts +64 -93
- package/src/gir/parse.ts +43 -95
- package/src/gir/primitives.ts +23 -45
- package/src/gir/property.ts +27 -29
- package/src/gir/record.ts +53 -0
- package/src/gir/size.ts +9 -56
- package/src/gir/type-id.ts +49 -0
- package/src/gir/type-ref.ts +35 -140
- package/src/gir/type.ts +16 -0
- package/src/index.ts +20 -15
- package/src/khronos/args.ts +202 -0
- package/src/khronos/jsdoc.ts +76 -0
- package/src/khronos/model.ts +166 -0
- package/src/khronos/modules.ts +75 -0
- package/src/khronos/parse.ts +66 -0
- package/src/khronos/pipeline.ts +234 -0
- package/src/khronos/plan.ts +191 -0
- package/src/khronos/registry/LICENSE +202 -0
- package/src/khronos/registry/gl.xml +47748 -0
- package/src/khronos/render.ts +193 -0
- package/src/khronos/select.ts +67 -0
- package/src/runner.ts +112 -75
- package/src/store/compile-store.ts +49 -0
- package/src/store/gi/async.ts +42 -0
- package/src/store/gi/callables.ts +309 -0
- package/src/store/gi/callback.ts +15 -0
- package/src/store/gi/class-struct-record.ts +40 -0
- package/src/store/gi/class.ts +212 -0
- package/src/store/gi/companion.ts +13 -0
- package/src/store/gi/constant.ts +24 -0
- package/src/store/gi/constructor-props.ts +82 -0
- package/src/store/gi/enum.ts +49 -0
- package/src/store/gi/function.ts +107 -0
- package/src/store/gi/gtype-binding.ts +33 -0
- package/src/store/gi/interface.ts +157 -0
- package/src/store/gi/item-comparators.ts +90 -0
- package/src/store/gi/method.ts +417 -0
- package/src/store/gi/param-marshal.ts +48 -0
- package/src/store/gi/pipeline.ts +85 -0
- package/src/store/gi/properties.ts +39 -0
- package/src/store/gi/property-accessor.ts +194 -0
- package/src/store/gi/record-constructor.ts +87 -0
- package/src/store/gi/record-field-accessor.ts +394 -0
- package/src/store/gi/record-layout.ts +134 -0
- package/src/store/gi/record.ts +66 -0
- package/src/store/gi/registration.ts +38 -0
- package/src/store/gi/return-wrap.ts +52 -0
- package/src/store/gi/runtime-override.ts +36 -0
- package/src/store/gi/signal.ts +310 -0
- package/src/store/gi/vtable.ts +99 -0
- package/src/store/gi-store.ts +79 -0
- package/src/store/jsx-store.ts +27 -0
- package/src/store/react/built-ins.ts +260 -0
- package/src/store/react/element-components.ts +138 -0
- package/src/store/react/element-prop-types.ts +280 -0
- package/src/store/react/element-props.ts +204 -0
- package/src/store/react/gir-index.ts +85 -0
- package/src/store/react/intrinsic-elements.ts +161 -0
- package/src/store/react/jsx.ts +294 -0
- package/src/store/react/metadata.ts +197 -0
- package/src/store/react/pipeline.ts +90 -0
- package/src/store/react/props.ts +197 -0
- package/src/store/store-fs.ts +112 -0
- package/src/writer/context.ts +48 -0
- package/src/writer/doc.ts +11 -0
- package/src/writer/emit.ts +26 -0
- package/src/writer/gtk-doc.ts +74 -0
- package/src/writer/imports.ts +59 -0
- package/src/writer/module.ts +45 -0
- package/LICENSE +0 -373
- package/dist/dsl/context.d.ts +0 -104
- package/dist/dsl/context.d.ts.map +0 -1
- package/dist/dsl/context.js +0 -140
- package/dist/dsl/context.js.map +0 -1
- package/dist/dsl/emit.d.ts +0 -28
- package/dist/dsl/emit.d.ts.map +0 -1
- package/dist/dsl/emit.js +0 -41
- package/dist/dsl/emit.js.map +0 -1
- package/dist/dsl/identifier.d.ts +0 -28
- package/dist/dsl/identifier.d.ts.map +0 -1
- package/dist/dsl/identifier.js +0 -45
- package/dist/dsl/identifier.js.map +0 -1
- package/dist/dsl/imports.d.ts +0 -58
- package/dist/dsl/imports.d.ts.map +0 -1
- package/dist/dsl/imports.js +0 -107
- package/dist/dsl/imports.js.map +0 -1
- package/dist/dsl/module.d.ts +0 -53
- package/dist/dsl/module.d.ts.map +0 -1
- package/dist/dsl/module.js +0 -76
- package/dist/dsl/module.js.map +0 -1
- package/dist/ffi/pipeline.d.ts +0 -19
- package/dist/ffi/pipeline.d.ts.map +0 -1
- package/dist/ffi/pipeline.js +0 -107
- package/dist/ffi/pipeline.js.map +0 -1
- package/dist/gi-store.d.ts +0 -34
- package/dist/gi-store.d.ts.map +0 -1
- package/dist/gi-store.js +0 -154
- package/dist/gi-store.js.map +0 -1
- package/dist/gir/boxed.d.ts +0 -66
- package/dist/gir/boxed.d.ts.map +0 -1
- package/dist/gir/boxed.js +0 -49
- package/dist/gir/boxed.js.map +0 -1
- package/dist/gir/qualified-name.d.ts +0 -37
- package/dist/gir/qualified-name.d.ts.map +0 -1
- package/dist/gir/qualified-name.js +0 -39
- package/dist/gir/qualified-name.js.map +0 -1
- package/dist/gir/qualify.d.ts +0 -32
- package/dist/gir/qualify.d.ts.map +0 -1
- package/dist/gir/qualify.js +0 -60
- package/dist/gir/qualify.js.map +0 -1
- package/dist/gir/repository.d.ts +0 -82
- package/dist/gir/repository.d.ts.map +0 -1
- package/dist/gir/repository.js +0 -122
- package/dist/gir/repository.js.map +0 -1
- package/dist/gir/signal.d.ts +0 -22
- package/dist/gir/signal.d.ts.map +0 -1
- package/dist/gir/signal.js +0 -20
- package/dist/gir/signal.js.map +0 -1
- package/dist/jsx-store.d.ts +0 -22
- package/dist/jsx-store.d.ts.map +0 -1
- package/dist/jsx-store.js +0 -40
- package/dist/jsx-store.js.map +0 -1
- package/dist/react/compounds-meta.d.ts +0 -18
- package/dist/react/compounds-meta.d.ts.map +0 -1
- package/dist/react/compounds-meta.js +0 -93
- package/dist/react/compounds-meta.js.map +0 -1
- package/dist/react/compounds.d.ts +0 -27
- package/dist/react/compounds.d.ts.map +0 -1
- package/dist/react/compounds.js +0 -164
- package/dist/react/compounds.js.map +0 -1
- package/dist/react/internal.d.ts +0 -14
- package/dist/react/internal.d.ts.map +0 -1
- package/dist/react/internal.js +0 -79
- package/dist/react/internal.js.map +0 -1
- package/dist/react/jsx.d.ts +0 -22
- package/dist/react/jsx.d.ts.map +0 -1
- package/dist/react/jsx.js +0 -134
- package/dist/react/jsx.js.map +0 -1
- package/dist/react/pipeline.d.ts +0 -13
- package/dist/react/pipeline.d.ts.map +0 -1
- package/dist/react/pipeline.js +0 -25
- package/dist/react/pipeline.js.map +0 -1
- package/dist/react/props.d.ts +0 -38
- package/dist/react/props.d.ts.map +0 -1
- package/dist/react/props.js +0 -231
- package/dist/react/props.js.map +0 -1
- package/dist/react/slot-props.d.ts +0 -10
- package/dist/react/slot-props.d.ts.map +0 -1
- package/dist/react/slot-props.js +0 -56
- package/dist/react/slot-props.js.map +0 -1
- package/dist/react/widgets.d.ts +0 -83
- package/dist/react/widgets.d.ts.map +0 -1
- package/dist/react/widgets.js +0 -152
- package/dist/react/widgets.js.map +0 -1
- package/dist/store-fs.d.ts +0 -109
- package/dist/store-fs.d.ts.map +0 -1
- package/dist/store-fs.js +0 -98
- package/dist/store-fs.js.map +0 -1
- package/dist/transpile.d.ts +0 -32
- package/dist/transpile.d.ts.map +0 -1
- package/dist/transpile.js +0 -63
- package/dist/transpile.js.map +0 -1
- package/dist/typecheck-store.d.ts +0 -41
- package/dist/typecheck-store.d.ts.map +0 -1
- package/dist/typecheck-store.js +0 -102
- package/dist/typecheck-store.js.map +0 -1
- package/dist/writers/alias.d.ts +0 -13
- package/dist/writers/alias.d.ts.map +0 -1
- package/dist/writers/alias.js +0 -17
- package/dist/writers/alias.js.map +0 -1
- package/dist/writers/async.d.ts +0 -22
- package/dist/writers/async.d.ts.map +0 -1
- package/dist/writers/async.js +0 -48
- package/dist/writers/async.js.map +0 -1
- package/dist/writers/boxed-constructor.d.ts +0 -26
- package/dist/writers/boxed-constructor.d.ts.map +0 -1
- package/dist/writers/boxed-constructor.js +0 -85
- package/dist/writers/boxed-constructor.js.map +0 -1
- package/dist/writers/boxed-field-accessor.d.ts +0 -18
- package/dist/writers/boxed-field-accessor.d.ts.map +0 -1
- package/dist/writers/boxed-field-accessor.js +0 -260
- package/dist/writers/boxed-field-accessor.js.map +0 -1
- package/dist/writers/boxed-layout.d.ts +0 -27
- package/dist/writers/boxed-layout.d.ts.map +0 -1
- package/dist/writers/boxed-layout.js +0 -128
- package/dist/writers/boxed-layout.js.map +0 -1
- package/dist/writers/boxed.d.ts +0 -20
- package/dist/writers/boxed.d.ts.map +0 -1
- package/dist/writers/boxed.js +0 -71
- package/dist/writers/boxed.js.map +0 -1
- package/dist/writers/callables.d.ts +0 -124
- package/dist/writers/callables.d.ts.map +0 -1
- package/dist/writers/callables.js +0 -283
- package/dist/writers/callables.js.map +0 -1
- package/dist/writers/callback.d.ts +0 -16
- package/dist/writers/callback.d.ts.map +0 -1
- package/dist/writers/callback.js +0 -38
- package/dist/writers/callback.js.map +0 -1
- package/dist/writers/class-struct-record.d.ts +0 -31
- package/dist/writers/class-struct-record.d.ts.map +0 -1
- package/dist/writers/class-struct-record.js +0 -67
- package/dist/writers/class-struct-record.js.map +0 -1
- package/dist/writers/class-struct.d.ts +0 -22
- package/dist/writers/class-struct.d.ts.map +0 -1
- package/dist/writers/class-struct.js +0 -85
- package/dist/writers/class-struct.js.map +0 -1
- package/dist/writers/class.d.ts +0 -16
- package/dist/writers/class.d.ts.map +0 -1
- package/dist/writers/class.js +0 -307
- package/dist/writers/class.js.map +0 -1
- package/dist/writers/constant.d.ts +0 -15
- package/dist/writers/constant.d.ts.map +0 -1
- package/dist/writers/constant.js +0 -23
- package/dist/writers/constant.js.map +0 -1
- package/dist/writers/constants.d.ts +0 -15
- package/dist/writers/constants.d.ts.map +0 -1
- package/dist/writers/constants.js +0 -23
- package/dist/writers/constants.js.map +0 -1
- package/dist/writers/constructor-props.d.ts +0 -32
- package/dist/writers/constructor-props.d.ts.map +0 -1
- package/dist/writers/constructor-props.js +0 -110
- package/dist/writers/constructor-props.js.map +0 -1
- package/dist/writers/enum.d.ts +0 -21
- package/dist/writers/enum.d.ts.map +0 -1
- package/dist/writers/enum.js +0 -48
- package/dist/writers/enum.js.map +0 -1
- package/dist/writers/function.d.ts +0 -40
- package/dist/writers/function.d.ts.map +0 -1
- package/dist/writers/function.js +0 -127
- package/dist/writers/function.js.map +0 -1
- package/dist/writers/gtype-binding.d.ts +0 -19
- package/dist/writers/gtype-binding.d.ts.map +0 -1
- package/dist/writers/gtype-binding.js +0 -40
- package/dist/writers/gtype-binding.js.map +0 -1
- package/dist/writers/inheritance.d.ts +0 -48
- package/dist/writers/inheritance.d.ts.map +0 -1
- package/dist/writers/inheritance.js +0 -90
- package/dist/writers/inheritance.js.map +0 -1
- package/dist/writers/interface.d.ts +0 -16
- package/dist/writers/interface.d.ts.map +0 -1
- package/dist/writers/interface.js +0 -155
- package/dist/writers/interface.js.map +0 -1
- package/dist/writers/method.d.ts +0 -150
- package/dist/writers/method.d.ts.map +0 -1
- package/dist/writers/method.js +0 -510
- package/dist/writers/method.js.map +0 -1
- package/dist/writers/param-classify.d.ts +0 -93
- package/dist/writers/param-classify.d.ts.map +0 -1
- package/dist/writers/param-classify.js +0 -163
- package/dist/writers/param-classify.js.map +0 -1
- package/dist/writers/property-accessor.d.ts +0 -19
- package/dist/writers/property-accessor.d.ts.map +0 -1
- package/dist/writers/property-accessor.js +0 -117
- package/dist/writers/property-accessor.js.map +0 -1
- package/dist/writers/registration.d.ts +0 -27
- package/dist/writers/registration.d.ts.map +0 -1
- package/dist/writers/registration.js +0 -30
- package/dist/writers/registration.js.map +0 -1
- package/dist/writers/return-wrap.d.ts +0 -39
- package/dist/writers/return-wrap.d.ts.map +0 -1
- package/dist/writers/return-wrap.js +0 -152
- package/dist/writers/return-wrap.js.map +0 -1
- package/dist/writers/runtime-override.d.ts +0 -18
- package/dist/writers/runtime-override.d.ts.map +0 -1
- package/dist/writers/runtime-override.js.map +0 -1
- package/dist/writers/signal.d.ts +0 -21
- package/dist/writers/signal.d.ts.map +0 -1
- package/dist/writers/signal.js +0 -260
- package/dist/writers/signal.js.map +0 -1
- package/dist/writers/ts-type.d.ts +0 -50
- package/dist/writers/ts-type.d.ts.map +0 -1
- package/dist/writers/ts-type.js +0 -75
- package/dist/writers/ts-type.js.map +0 -1
- package/dist/writers/types-ts.d.ts +0 -27
- package/dist/writers/types-ts.d.ts.map +0 -1
- package/dist/writers/types-ts.js +0 -97
- package/dist/writers/types-ts.js.map +0 -1
- package/dist/writers/value.d.ts +0 -89
- package/dist/writers/value.d.ts.map +0 -1
- package/dist/writers/value.js +0 -402
- package/dist/writers/value.js.map +0 -1
- package/src/dsl/context.ts +0 -146
- package/src/dsl/emit.ts +0 -42
- package/src/dsl/identifier.ts +0 -52
- package/src/dsl/imports.ts +0 -109
- package/src/dsl/module.ts +0 -75
- package/src/ffi/pipeline.ts +0 -113
- package/src/gi-store.ts +0 -199
- package/src/gir/boxed.ts +0 -94
- package/src/gir/qualified-name.ts +0 -55
- package/src/gir/qualify.ts +0 -64
- package/src/gir/repository.ts +0 -149
- package/src/gir/signal.ts +0 -36
- package/src/jsx-store.ts +0 -53
- package/src/react/compounds-meta.ts +0 -99
- package/src/react/compounds.ts +0 -204
- package/src/react/internal.ts +0 -91
- package/src/react/jsx.ts +0 -155
- package/src/react/pipeline.ts +0 -29
- package/src/react/props.ts +0 -307
- package/src/react/slot-props.ts +0 -57
- package/src/react/widgets.ts +0 -185
- package/src/store-fs.ts +0 -157
- package/src/transpile.ts +0 -80
- package/src/typecheck-store.ts +0 -136
- package/src/writers/alias.ts +0 -19
- package/src/writers/async.ts +0 -44
- package/src/writers/boxed-constructor.ts +0 -105
- package/src/writers/boxed-field-accessor.ts +0 -306
- package/src/writers/boxed-layout.ts +0 -166
- package/src/writers/boxed.ts +0 -77
- package/src/writers/callables.ts +0 -339
- package/src/writers/callback.ts +0 -40
- package/src/writers/class-struct-record.ts +0 -75
- package/src/writers/class-struct.ts +0 -96
- package/src/writers/class.ts +0 -384
- package/src/writers/constant.ts +0 -29
- package/src/writers/constructor-props.ts +0 -130
- package/src/writers/enum.ts +0 -53
- package/src/writers/function.ts +0 -136
- package/src/writers/gtype-binding.ts +0 -48
- package/src/writers/inheritance.ts +0 -104
- package/src/writers/interface.ts +0 -168
- package/src/writers/method.ts +0 -678
- package/src/writers/param-classify.ts +0 -178
- package/src/writers/property-accessor.ts +0 -139
- package/src/writers/registration.ts +0 -42
- package/src/writers/return-wrap.ts +0 -180
- package/src/writers/runtime-override.ts +0 -59
- package/src/writers/signal.ts +0 -318
- package/src/writers/ts-type.ts +0 -115
- package/src/writers/value.ts +0 -485
package/dist/dsl/emit.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tiny string-builder helpers used by the writers to assemble TypeScript
|
|
3
|
-
* source. The DSL deliberately stops short of modelling expressions or
|
|
4
|
-
* statements — writers compose strings directly using these primitives.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Indents each line of `block` by `level` four-space units.
|
|
8
|
-
*
|
|
9
|
-
* Lines that are empty stay empty (no trailing whitespace).
|
|
10
|
-
*
|
|
11
|
-
* @param block - The multi-line source fragment
|
|
12
|
-
* @param level - Number of indentation steps to apply
|
|
13
|
-
*/
|
|
14
|
-
export const indent = (block, level) => {
|
|
15
|
-
if (level <= 0)
|
|
16
|
-
return block;
|
|
17
|
-
const prefix = " ".repeat(level);
|
|
18
|
-
return block
|
|
19
|
-
.split("\n")
|
|
20
|
-
.map((line) => (line.length === 0 ? line : `${prefix}${line}`))
|
|
21
|
-
.join("\n");
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Joins `parts` with commas, dropping `undefined` entries.
|
|
25
|
-
*/
|
|
26
|
-
export const joinArgs = (parts) => parts.filter((part) => part !== undefined).join(", ");
|
|
27
|
-
/**
|
|
28
|
-
* Renders an array literal multi-line, indenting each element four spaces
|
|
29
|
-
* and adding a trailing comma.
|
|
30
|
-
*
|
|
31
|
-
* Empty input renders as `[]`.
|
|
32
|
-
*
|
|
33
|
-
* @param elements - Already-rendered element expressions
|
|
34
|
-
*/
|
|
35
|
-
export const arrayLiteral = (elements) => {
|
|
36
|
-
if (elements.length === 0)
|
|
37
|
-
return "[]";
|
|
38
|
-
const lines = elements.map((element) => ` ${element},`);
|
|
39
|
-
return `[\n${lines.join("\n")}\n]`;
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=emit.js.map
|
package/dist/dsl/emit.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/dsl/emit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,KAAa,EAAU,EAAE;IAC3D,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,OAAO,KAAK;SACP,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC;SAC9D,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAwC,EAAU,EAAE,CACzE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE1E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAA2B,EAAU,EAAE;IAChE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,OAAO,GAAG,CAAC,CAAC;IAC3D,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACvC,CAAC,CAAC"}
|
package/dist/dsl/identifier.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Derives the public camelCase export name for a namespace-level callable.
|
|
3
|
-
*
|
|
4
|
-
* The GIR `name` attribute is camelCased (`quark_from_string` →
|
|
5
|
-
* `quarkFromString`); for a shadowing function it is the shadowed short name,
|
|
6
|
-
* so `g_idle_add_full` (which shadows `idle_add`) exports as `idleAdd`. When the
|
|
7
|
-
* `name` is empty the C identifier is used instead, with the namespace's
|
|
8
|
-
* `c:symbol-prefixes` value stripped (e.g. `g_` from `g_quark_from_string`).
|
|
9
|
-
* The result is escaped so it never collides with a reserved word.
|
|
10
|
-
*
|
|
11
|
-
* @param cIdentifier - The C symbol identifier from GIR
|
|
12
|
-
* @param girName - The GIR `name` attribute (shadow-resolved)
|
|
13
|
-
* @param symbolPrefixes - The namespace's `c:symbol-prefixes` values
|
|
14
|
-
*/
|
|
15
|
-
export declare const namespaceFunctionExportName: (cIdentifier: string, girName: string, symbolPrefixes: readonly string[]) => string;
|
|
16
|
-
/**
|
|
17
|
-
* Derives the exported identifier for a GIR `<alias>`.
|
|
18
|
-
*
|
|
19
|
-
* Aliases are surfaced under their GIR `name` (e.g. `Quark`, `Pid`,
|
|
20
|
-
* `Allocation`), matching the `@girs` convention. GObject's `Type` alias is the
|
|
21
|
-
* one exception: it is published as `GType` so it lines up with the GObject
|
|
22
|
-
* runtime's `GType` type and the references that resolve through it.
|
|
23
|
-
*
|
|
24
|
-
* @param namespaceName - The namespace the alias is declared in
|
|
25
|
-
* @param aliasName - The alias's GIR `name`
|
|
26
|
-
*/
|
|
27
|
-
export declare const aliasExportName: (namespaceName: string, aliasName: string) => string;
|
|
28
|
-
//# sourceMappingURL=identifier.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../src/dsl/identifier.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B,GACpC,aAAa,MAAM,EACnB,SAAS,MAAM,EACf,gBAAgB,SAAS,MAAM,EAAE,KAClC,MAMF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAI,eAAe,MAAM,EAAE,WAAW,MAAM,KAAG,MACE,CAAC"}
|
package/dist/dsl/identifier.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { toCamelCase, toIdentifier } from "@gtkx/utils";
|
|
2
|
-
/**
|
|
3
|
-
* Derives the public camelCase export name for a namespace-level callable.
|
|
4
|
-
*
|
|
5
|
-
* The GIR `name` attribute is camelCased (`quark_from_string` →
|
|
6
|
-
* `quarkFromString`); for a shadowing function it is the shadowed short name,
|
|
7
|
-
* so `g_idle_add_full` (which shadows `idle_add`) exports as `idleAdd`. When the
|
|
8
|
-
* `name` is empty the C identifier is used instead, with the namespace's
|
|
9
|
-
* `c:symbol-prefixes` value stripped (e.g. `g_` from `g_quark_from_string`).
|
|
10
|
-
* The result is escaped so it never collides with a reserved word.
|
|
11
|
-
*
|
|
12
|
-
* @param cIdentifier - The C symbol identifier from GIR
|
|
13
|
-
* @param girName - The GIR `name` attribute (shadow-resolved)
|
|
14
|
-
* @param symbolPrefixes - The namespace's `c:symbol-prefixes` values
|
|
15
|
-
*/
|
|
16
|
-
export const namespaceFunctionExportName = (cIdentifier, girName, symbolPrefixes) => {
|
|
17
|
-
if (girName.length > 0) {
|
|
18
|
-
return toIdentifier(toCamelCase(girName));
|
|
19
|
-
}
|
|
20
|
-
const stripped = stripLongestPrefix(cIdentifier, symbolPrefixes);
|
|
21
|
-
return toIdentifier(toCamelCase(stripped));
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Derives the exported identifier for a GIR `<alias>`.
|
|
25
|
-
*
|
|
26
|
-
* Aliases are surfaced under their GIR `name` (e.g. `Quark`, `Pid`,
|
|
27
|
-
* `Allocation`), matching the `@girs` convention. GObject's `Type` alias is the
|
|
28
|
-
* one exception: it is published as `GType` so it lines up with the GObject
|
|
29
|
-
* runtime's `GType` type and the references that resolve through it.
|
|
30
|
-
*
|
|
31
|
-
* @param namespaceName - The namespace the alias is declared in
|
|
32
|
-
* @param aliasName - The alias's GIR `name`
|
|
33
|
-
*/
|
|
34
|
-
export const aliasExportName = (namespaceName, aliasName) => namespaceName === "GObject" && aliasName === "Type" ? "GType" : aliasName;
|
|
35
|
-
const stripLongestPrefix = (input, prefixes) => {
|
|
36
|
-
let best = "";
|
|
37
|
-
for (const prefix of prefixes) {
|
|
38
|
-
const candidate = `${prefix}_`;
|
|
39
|
-
if (input.startsWith(candidate) && candidate.length > best.length) {
|
|
40
|
-
best = candidate;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return best.length === 0 ? input : input.slice(best.length);
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=identifier.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../src/dsl/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACvC,WAAmB,EACnB,OAAe,EACf,cAAiC,EAC3B,EAAE;IACR,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IACjE,OAAO,YAAY,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,aAAqB,EAAE,SAAiB,EAAU,EAAE,CAChF,aAAa,KAAK,SAAS,IAAI,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAE9E,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAE,QAA2B,EAAU,EAAE;IAC9E,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,SAAS,GAAG,GAAG,MAAM,GAAG,CAAC;QAC/B,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAChE,IAAI,GAAG,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAChE,CAAC,CAAC"}
|
package/dist/dsl/imports.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tracks imports for a single generated module.
|
|
3
|
-
*
|
|
4
|
-
* The DSL is intentionally tiny: it covers what is awkward to do with
|
|
5
|
-
* string concatenation (deduplicating named imports, sorting them, mixing
|
|
6
|
-
* side-effect and named imports from the same specifier) and leaves
|
|
7
|
-
* everything else to raw TS strings the writers compose themselves.
|
|
8
|
-
*/
|
|
9
|
-
export declare class ImportsBuilder {
|
|
10
|
-
private readonly named;
|
|
11
|
-
private readonly defaultNames;
|
|
12
|
-
private readonly namespaces;
|
|
13
|
-
private readonly sideEffects;
|
|
14
|
-
/**
|
|
15
|
-
* Records a named import: `import { foo, bar } from "lib"`.
|
|
16
|
-
*
|
|
17
|
-
* Repeated calls deduplicate; the final emit alphabetises within the
|
|
18
|
-
* braces. A name is emitted with the inline `type` modifier only when
|
|
19
|
-
* every recording of it is type-only — a single value import of the same
|
|
20
|
-
* name keeps it a value import.
|
|
21
|
-
*
|
|
22
|
-
* @param specifier - The module specifier (e.g. `"@gtkx/ffi"`)
|
|
23
|
-
* @param name - The identifier to import
|
|
24
|
-
* @param isType - Whether this recording is type-only (`import { type X }`)
|
|
25
|
-
*/
|
|
26
|
-
addNamed(specifier: string, name: string, isType?: boolean): void;
|
|
27
|
-
/**
|
|
28
|
-
* Records a namespace import: `import * as Alias from "lib"`.
|
|
29
|
-
*
|
|
30
|
-
* The first call wins if a different alias is reused for the same
|
|
31
|
-
* specifier.
|
|
32
|
-
*
|
|
33
|
-
* @param specifier - The module specifier
|
|
34
|
-
* @param alias - The local alias bound by the import
|
|
35
|
-
*/
|
|
36
|
-
addNamespace(specifier: string, alias: string): void;
|
|
37
|
-
/**
|
|
38
|
-
* Records a default import: `import Alias from "lib"`. Subsequent calls
|
|
39
|
-
* with a different alias are ignored.
|
|
40
|
-
*
|
|
41
|
-
* @param specifier - The module specifier
|
|
42
|
-
* @param alias - The local name bound to the default export
|
|
43
|
-
*/
|
|
44
|
-
addDefault(specifier: string, alias: string): void;
|
|
45
|
-
/**
|
|
46
|
-
* Records a side-effect-only import: `import "lib"`.
|
|
47
|
-
*
|
|
48
|
-
* @param specifier - The module specifier
|
|
49
|
-
*/
|
|
50
|
-
addSideEffect(specifier: string): void;
|
|
51
|
-
/**
|
|
52
|
-
* Renders all imports as a single string ending with a trailing
|
|
53
|
-
* newline. Side-effect imports come first (in insertion order),
|
|
54
|
-
* followed by named/namespace/default imports sorted by specifier.
|
|
55
|
-
*/
|
|
56
|
-
toSource(): string;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=imports.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/dsl/imports.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,cAAc;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2C;IACjE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAEjD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG,IAAI;IAS/D;;;;;;;;OAQG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAMpD;;;;;;OAMG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAMlD;;;;OAIG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAItC;;;;OAIG;IACH,QAAQ,IAAI,MAAM;CA6BrB"}
|
package/dist/dsl/imports.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { quote } from "@gtkx/utils";
|
|
2
|
-
/**
|
|
3
|
-
* Tracks imports for a single generated module.
|
|
4
|
-
*
|
|
5
|
-
* The DSL is intentionally tiny: it covers what is awkward to do with
|
|
6
|
-
* string concatenation (deduplicating named imports, sorting them, mixing
|
|
7
|
-
* side-effect and named imports from the same specifier) and leaves
|
|
8
|
-
* everything else to raw TS strings the writers compose themselves.
|
|
9
|
-
*/
|
|
10
|
-
export class ImportsBuilder {
|
|
11
|
-
named = new Map();
|
|
12
|
-
defaultNames = new Map();
|
|
13
|
-
namespaces = new Map();
|
|
14
|
-
sideEffects = new Set();
|
|
15
|
-
/**
|
|
16
|
-
* Records a named import: `import { foo, bar } from "lib"`.
|
|
17
|
-
*
|
|
18
|
-
* Repeated calls deduplicate; the final emit alphabetises within the
|
|
19
|
-
* braces. A name is emitted with the inline `type` modifier only when
|
|
20
|
-
* every recording of it is type-only — a single value import of the same
|
|
21
|
-
* name keeps it a value import.
|
|
22
|
-
*
|
|
23
|
-
* @param specifier - The module specifier (e.g. `"@gtkx/ffi"`)
|
|
24
|
-
* @param name - The identifier to import
|
|
25
|
-
* @param isType - Whether this recording is type-only (`import { type X }`)
|
|
26
|
-
*/
|
|
27
|
-
addNamed(specifier, name, isType = false) {
|
|
28
|
-
let bucket = this.named.get(specifier);
|
|
29
|
-
if (bucket === undefined) {
|
|
30
|
-
bucket = new Map();
|
|
31
|
-
this.named.set(specifier, bucket);
|
|
32
|
-
}
|
|
33
|
-
bucket.set(name, (bucket.get(name) ?? true) && isType);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Records a namespace import: `import * as Alias from "lib"`.
|
|
37
|
-
*
|
|
38
|
-
* The first call wins if a different alias is reused for the same
|
|
39
|
-
* specifier.
|
|
40
|
-
*
|
|
41
|
-
* @param specifier - The module specifier
|
|
42
|
-
* @param alias - The local alias bound by the import
|
|
43
|
-
*/
|
|
44
|
-
addNamespace(specifier, alias) {
|
|
45
|
-
if (!this.namespaces.has(specifier)) {
|
|
46
|
-
this.namespaces.set(specifier, alias);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Records a default import: `import Alias from "lib"`. Subsequent calls
|
|
51
|
-
* with a different alias are ignored.
|
|
52
|
-
*
|
|
53
|
-
* @param specifier - The module specifier
|
|
54
|
-
* @param alias - The local name bound to the default export
|
|
55
|
-
*/
|
|
56
|
-
addDefault(specifier, alias) {
|
|
57
|
-
if (!this.defaultNames.has(specifier)) {
|
|
58
|
-
this.defaultNames.set(specifier, alias);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Records a side-effect-only import: `import "lib"`.
|
|
63
|
-
*
|
|
64
|
-
* @param specifier - The module specifier
|
|
65
|
-
*/
|
|
66
|
-
addSideEffect(specifier) {
|
|
67
|
-
this.sideEffects.add(specifier);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Renders all imports as a single string ending with a trailing
|
|
71
|
-
* newline. Side-effect imports come first (in insertion order),
|
|
72
|
-
* followed by named/namespace/default imports sorted by specifier.
|
|
73
|
-
*/
|
|
74
|
-
toSource() {
|
|
75
|
-
const lines = [];
|
|
76
|
-
for (const specifier of this.sideEffects) {
|
|
77
|
-
lines.push(`import ${quote(specifier)};`);
|
|
78
|
-
}
|
|
79
|
-
const specifiers = new Set([
|
|
80
|
-
...this.named.keys(),
|
|
81
|
-
...this.namespaces.keys(),
|
|
82
|
-
...this.defaultNames.keys(),
|
|
83
|
-
]);
|
|
84
|
-
const sortedSpecifiers = [...specifiers].sort((a, b) => a.localeCompare(b));
|
|
85
|
-
for (const specifier of sortedSpecifiers) {
|
|
86
|
-
const defaultAlias = this.defaultNames.get(specifier);
|
|
87
|
-
const namespaceAlias = this.namespaces.get(specifier);
|
|
88
|
-
const namedNames = this.named.get(specifier);
|
|
89
|
-
const parts = [];
|
|
90
|
-
if (defaultAlias !== undefined)
|
|
91
|
-
parts.push(defaultAlias);
|
|
92
|
-
if (namespaceAlias !== undefined)
|
|
93
|
-
parts.push(`* as ${namespaceAlias}`);
|
|
94
|
-
if (namedNames !== undefined && namedNames.size > 0) {
|
|
95
|
-
const sortedNames = [...namedNames.entries()]
|
|
96
|
-
.sort(([a], [b]) => a.localeCompare(b))
|
|
97
|
-
.map(([name, isType]) => (isType ? `type ${name}` : name));
|
|
98
|
-
parts.push(`{ ${sortedNames.join(", ")} }`);
|
|
99
|
-
}
|
|
100
|
-
if (parts.length === 0)
|
|
101
|
-
continue;
|
|
102
|
-
lines.push(`import ${parts.join(", ")} from ${quote(specifier)};`);
|
|
103
|
-
}
|
|
104
|
-
return lines.length === 0 ? "" : `${lines.join("\n")}\n`;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=imports.js.map
|
package/dist/dsl/imports.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../../src/dsl/imports.ts"],"names":[],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gBAClD,MAAM,WAAW,GAAG,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;qBACxC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;qBACtC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC/D,KAAK,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChD,CAAC;YACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAS;YACjC,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC7D,CAAC;CACJ"}
|
package/dist/dsl/module.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ImportsBuilder } from "./imports.js";
|
|
2
|
-
/**
|
|
3
|
-
* Accumulator for one generated TypeScript module's source.
|
|
4
|
-
*
|
|
5
|
-
* Writers append code in three logical phases:
|
|
6
|
-
*
|
|
7
|
-
* 1. *Bindings* — the `const fn_name = t.fn(...)` block at the top.
|
|
8
|
-
* 2. *Declarations* — the class bodies, free function exports, enums,
|
|
9
|
-
* constants.
|
|
10
|
-
* 3. *Registrations* — the trailing `registerNativeClass(...)` block.
|
|
11
|
-
*
|
|
12
|
-
* Keeping the three buckets independent removes ordering constraints
|
|
13
|
-
* between writers and lets {@link emit} stitch a final source string with
|
|
14
|
-
* the same shape every generated file uses today.
|
|
15
|
-
*/
|
|
16
|
-
export declare class ModuleBuilder {
|
|
17
|
-
/** Imports manifest the writers feed into. */
|
|
18
|
-
readonly imports: ImportsBuilder;
|
|
19
|
-
private readonly bindings;
|
|
20
|
-
private readonly bindingNames;
|
|
21
|
-
private readonly declarations;
|
|
22
|
-
private readonly registrations;
|
|
23
|
-
/**
|
|
24
|
-
* Appends a top-level FFI binding (`const foo = t.fn(...)`).
|
|
25
|
-
*
|
|
26
|
-
* Duplicates are dropped when a `name` is supplied that matches a
|
|
27
|
-
* previously appended binding; this is the common case for GIR
|
|
28
|
-
* callables that appear both as a namespace function and as a
|
|
29
|
-
* constructor or static on a class.
|
|
30
|
-
*
|
|
31
|
-
* @param code - The source fragment, without a trailing newline
|
|
32
|
-
* @param name - Optional binding identifier used for deduplication
|
|
33
|
-
*/
|
|
34
|
-
appendBinding(code: string, name?: string): void;
|
|
35
|
-
/**
|
|
36
|
-
* Appends a declaration (class, function, enum, constant).
|
|
37
|
-
*
|
|
38
|
-
* @param code - The source fragment, without a trailing newline
|
|
39
|
-
*/
|
|
40
|
-
appendDeclaration(code: string): void;
|
|
41
|
-
/**
|
|
42
|
-
* Appends a trailing registration statement (`registerNativeClass(…)`).
|
|
43
|
-
*
|
|
44
|
-
* @param code - The source fragment, without a trailing newline
|
|
45
|
-
*/
|
|
46
|
-
appendRegistration(code: string): void;
|
|
47
|
-
/**
|
|
48
|
-
* Renders the full TypeScript source: imports, bindings, declarations,
|
|
49
|
-
* registrations — separated by a single blank line.
|
|
50
|
-
*/
|
|
51
|
-
toSource(): string;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=module.d.ts.map
|
package/dist/dsl/module.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/dsl/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACH,qBAAa,aAAa;IACtB,8CAA8C;IAC9C,SAAgB,OAAO,iBAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqB;IAClD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;IAC7C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAE9C;;;;;;;;;;OAUG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAQhD;;;;OAIG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIrC;;;;OAIG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAItC;;;OAGG;IACH,QAAQ,IAAI,MAAM;CASrB"}
|
package/dist/dsl/module.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ImportsBuilder } from "./imports.js";
|
|
2
|
-
/**
|
|
3
|
-
* Accumulator for one generated TypeScript module's source.
|
|
4
|
-
*
|
|
5
|
-
* Writers append code in three logical phases:
|
|
6
|
-
*
|
|
7
|
-
* 1. *Bindings* — the `const fn_name = t.fn(...)` block at the top.
|
|
8
|
-
* 2. *Declarations* — the class bodies, free function exports, enums,
|
|
9
|
-
* constants.
|
|
10
|
-
* 3. *Registrations* — the trailing `registerNativeClass(...)` block.
|
|
11
|
-
*
|
|
12
|
-
* Keeping the three buckets independent removes ordering constraints
|
|
13
|
-
* between writers and lets {@link emit} stitch a final source string with
|
|
14
|
-
* the same shape every generated file uses today.
|
|
15
|
-
*/
|
|
16
|
-
export class ModuleBuilder {
|
|
17
|
-
/** Imports manifest the writers feed into. */
|
|
18
|
-
imports = new ImportsBuilder();
|
|
19
|
-
bindings = [];
|
|
20
|
-
bindingNames = new Set();
|
|
21
|
-
declarations = [];
|
|
22
|
-
registrations = [];
|
|
23
|
-
/**
|
|
24
|
-
* Appends a top-level FFI binding (`const foo = t.fn(...)`).
|
|
25
|
-
*
|
|
26
|
-
* Duplicates are dropped when a `name` is supplied that matches a
|
|
27
|
-
* previously appended binding; this is the common case for GIR
|
|
28
|
-
* callables that appear both as a namespace function and as a
|
|
29
|
-
* constructor or static on a class.
|
|
30
|
-
*
|
|
31
|
-
* @param code - The source fragment, without a trailing newline
|
|
32
|
-
* @param name - Optional binding identifier used for deduplication
|
|
33
|
-
*/
|
|
34
|
-
appendBinding(code, name) {
|
|
35
|
-
if (name !== undefined) {
|
|
36
|
-
if (this.bindingNames.has(name))
|
|
37
|
-
return;
|
|
38
|
-
this.bindingNames.add(name);
|
|
39
|
-
}
|
|
40
|
-
this.bindings.push(code);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Appends a declaration (class, function, enum, constant).
|
|
44
|
-
*
|
|
45
|
-
* @param code - The source fragment, without a trailing newline
|
|
46
|
-
*/
|
|
47
|
-
appendDeclaration(code) {
|
|
48
|
-
this.declarations.push(code);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Appends a trailing registration statement (`registerNativeClass(…)`).
|
|
52
|
-
*
|
|
53
|
-
* @param code - The source fragment, without a trailing newline
|
|
54
|
-
*/
|
|
55
|
-
appendRegistration(code) {
|
|
56
|
-
this.registrations.push(code);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Renders the full TypeScript source: imports, bindings, declarations,
|
|
60
|
-
* registrations — separated by a single blank line.
|
|
61
|
-
*/
|
|
62
|
-
toSource() {
|
|
63
|
-
const sections = [];
|
|
64
|
-
const importsBlock = this.imports.toSource();
|
|
65
|
-
if (importsBlock.length > 0)
|
|
66
|
-
sections.push(importsBlock.trimEnd());
|
|
67
|
-
if (this.bindings.length > 0)
|
|
68
|
-
sections.push(this.bindings.join("\n\n"));
|
|
69
|
-
if (this.declarations.length > 0)
|
|
70
|
-
sections.push(this.declarations.join("\n\n"));
|
|
71
|
-
if (this.registrations.length > 0)
|
|
72
|
-
sections.push(this.registrations.join("\n\n"));
|
|
73
|
-
return `${sections.join("\n\n")}\n`;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=module.js.map
|
package/dist/dsl/module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/dsl/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,aAAa;IACtB,8CAA8C;IAC9B,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;IAC9B,QAAQ,GAAa,EAAE,CAAC;IACxB,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,YAAY,GAAa,EAAE,CAAC;IAC5B,aAAa,GAAa,EAAE,CAAC;IAE9C;;;;;;;;;;OAUG;IACH,aAAa,CAAC,IAAY,EAAE,IAAa;QACrC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACrB,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,OAAO;YACxC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,IAAY;QAC1B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,IAAY;QAC3B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,QAAQ;QACJ,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAC7C,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC;QACnE,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACxE,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAChF,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAClF,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACxC,CAAC;CACJ"}
|
package/dist/ffi/pipeline.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { GirNamespace } from "../gir/namespace.js";
|
|
2
|
-
import type { GirRepository } from "../gir/repository.js";
|
|
3
|
-
/**
|
|
4
|
-
* Generates the TypeScript source for one FFI namespace module.
|
|
5
|
-
*
|
|
6
|
-
* Walks the namespace's declared enums, boxeds, classes, interfaces,
|
|
7
|
-
* callbacks, functions, constants, and aliases, dispatching to the
|
|
8
|
-
* per-construct writers in `writers/`: bindings first, declarations second,
|
|
9
|
-
* registrations trailing.
|
|
10
|
-
*
|
|
11
|
-
* @param namespace - The namespace to emit
|
|
12
|
-
* @param repository - The full repository (for cross-namespace lookups)
|
|
13
|
-
* @returns The relative output path and the TypeScript source string
|
|
14
|
-
*/
|
|
15
|
-
export declare const generateNamespaceModule: (namespace: GirNamespace, repository: GirRepository) => {
|
|
16
|
-
readonly path: string;
|
|
17
|
-
readonly source: string;
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/ffi/pipeline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAU1D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,GAChC,WAAW,YAAY,EACvB,YAAY,aAAa,KAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAmClD,CAAC"}
|
package/dist/ffi/pipeline.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { ModuleContext } from "../dsl/context.js";
|
|
2
|
-
import { emitAlias } from "../writers/alias.js";
|
|
3
|
-
import { emitBoxed } from "../writers/boxed.js";
|
|
4
|
-
import { emitCallback } from "../writers/callback.js";
|
|
5
|
-
import { emitClass } from "../writers/class.js";
|
|
6
|
-
import { emitConstant } from "../writers/constant.js";
|
|
7
|
-
import { emitEnum } from "../writers/enum.js";
|
|
8
|
-
import { emitNamespaceBootstrap, emitNamespaceFunction } from "../writers/function.js";
|
|
9
|
-
import { emitInterface } from "../writers/interface.js";
|
|
10
|
-
/**
|
|
11
|
-
* Generates the TypeScript source for one FFI namespace module.
|
|
12
|
-
*
|
|
13
|
-
* Walks the namespace's declared enums, boxeds, classes, interfaces,
|
|
14
|
-
* callbacks, functions, constants, and aliases, dispatching to the
|
|
15
|
-
* per-construct writers in `writers/`: bindings first, declarations second,
|
|
16
|
-
* registrations trailing.
|
|
17
|
-
*
|
|
18
|
-
* @param namespace - The namespace to emit
|
|
19
|
-
* @param repository - The full repository (for cross-namespace lookups)
|
|
20
|
-
* @returns The relative output path and the TypeScript source string
|
|
21
|
-
*/
|
|
22
|
-
export const generateNamespaceModule = (namespace, repository) => {
|
|
23
|
-
const context = new ModuleContext(namespace, repository);
|
|
24
|
-
context.addGObjectBootstrapImports();
|
|
25
|
-
for (const enumeration of namespace.enums) {
|
|
26
|
-
emitEnum(context, enumeration);
|
|
27
|
-
}
|
|
28
|
-
for (const boxed of namespace.boxeds) {
|
|
29
|
-
emitBoxed(context, boxed);
|
|
30
|
-
}
|
|
31
|
-
for (const klass of topologicalClassOrder(namespace.classes, namespace.name)) {
|
|
32
|
-
emitClass(context, klass);
|
|
33
|
-
}
|
|
34
|
-
for (const iface of namespace.interfaces) {
|
|
35
|
-
emitInterface(context, iface);
|
|
36
|
-
}
|
|
37
|
-
for (const callback of namespace.callbacks) {
|
|
38
|
-
emitCallback(context, callback);
|
|
39
|
-
}
|
|
40
|
-
for (const fn of namespace.functions) {
|
|
41
|
-
emitNamespaceFunction(context, fn);
|
|
42
|
-
}
|
|
43
|
-
emitNamespaceBootstrap(context, namespace);
|
|
44
|
-
for (const constant of namespace.constants) {
|
|
45
|
-
emitConstant(context, constant);
|
|
46
|
-
}
|
|
47
|
-
for (const alias of namespace.aliases) {
|
|
48
|
-
emitAlias(context, alias);
|
|
49
|
-
}
|
|
50
|
-
const directory = namespace.name.toLowerCase();
|
|
51
|
-
return {
|
|
52
|
-
path: `${directory}/${directory}.ts`,
|
|
53
|
-
source: context.module.toSource(),
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Returns the namespace's classes ordered so each class is preceded by every
|
|
58
|
-
* same-namespace ancestor it extends.
|
|
59
|
-
*
|
|
60
|
-
* Generated JS classes use `extends`, which is a runtime reference: a child
|
|
61
|
-
* class declaration that names its parent before the parent's class body runs
|
|
62
|
-
* hits a temporal dead-zone error. GIR file order is source order, which does
|
|
63
|
-
* not match the inheritance order for namespaces where a leaf type (e.g.
|
|
64
|
-
* `GObject.Binding`) is declared earlier in the file than its base (e.g.
|
|
65
|
-
* `GObject.Object`). The codegen sorts by inheritance instead.
|
|
66
|
-
*
|
|
67
|
-
* Cross-namespace parents are imported by the writer and do not participate in
|
|
68
|
-
* the sort.
|
|
69
|
-
*
|
|
70
|
-
* @param classes - The classes to order
|
|
71
|
-
* @param namespaceName - The namespace these classes live in
|
|
72
|
-
*/
|
|
73
|
-
const topologicalClassOrder = (classes, namespaceName) => {
|
|
74
|
-
const byLocalName = new Map();
|
|
75
|
-
for (const klass of classes)
|
|
76
|
-
byLocalName.set(klass.name, klass);
|
|
77
|
-
const result = [];
|
|
78
|
-
const placed = new Set();
|
|
79
|
-
const visiting = new Set();
|
|
80
|
-
const visit = (klass) => {
|
|
81
|
-
if (placed.has(klass))
|
|
82
|
-
return;
|
|
83
|
-
if (visiting.has(klass))
|
|
84
|
-
return;
|
|
85
|
-
visiting.add(klass);
|
|
86
|
-
const parent = sameNamespaceParent(klass, namespaceName, byLocalName);
|
|
87
|
-
if (parent !== undefined)
|
|
88
|
-
visit(parent);
|
|
89
|
-
visiting.delete(klass);
|
|
90
|
-
placed.add(klass);
|
|
91
|
-
result.push(klass);
|
|
92
|
-
};
|
|
93
|
-
for (const klass of classes)
|
|
94
|
-
visit(klass);
|
|
95
|
-
return result;
|
|
96
|
-
};
|
|
97
|
-
const sameNamespaceParent = (klass, namespaceName, byLocalName) => {
|
|
98
|
-
if (klass.parent === undefined)
|
|
99
|
-
return undefined;
|
|
100
|
-
const dot = klass.parent.indexOf(".");
|
|
101
|
-
if (dot === -1)
|
|
102
|
-
return byLocalName.get(klass.parent);
|
|
103
|
-
if (klass.parent.slice(0, dot) !== namespaceName)
|
|
104
|
-
return undefined;
|
|
105
|
-
return byLocalName.get(klass.parent.slice(dot + 1));
|
|
106
|
-
};
|
|
107
|
-
//# sourceMappingURL=pipeline.js.map
|
package/dist/ffi/pipeline.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/ffi/pipeline.ts"],"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
|
3
|
-
/**
|
|
4
|
-
* Options for assembling the injected `@gtkx/gi` package.
|
|
5
|
-
*/
|
|
6
|
-
export type GiStoreOptions = StoreOptions & {
|
|
7
|
-
/** Real (symlink-resolved) directory of the installed `@gtkx/ffi`. */
|
|
8
|
-
readonly realFfiDir: string;
|
|
9
|
-
/** Real (symlink-resolved) directory of the installed `@gtkx/native`. */
|
|
10
|
-
readonly realNativeDir: string;
|
|
11
|
-
};
|
|
12
|
-
/** Per-namespace inputs the store assembler turns into gi modules. */
|
|
13
|
-
export type GiNamespaceInput = {
|
|
14
|
-
/** Lowercased namespace directory name (e.g. `"gtk"`). */
|
|
15
|
-
readonly directory: string;
|
|
16
|
-
/** Transpilable raw module source, or `null` for augment-only namespaces (gl). */
|
|
17
|
-
readonly rawSource: string | null;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Assembles the self-contained injected `@gtkx/gi` package.
|
|
21
|
-
*
|
|
22
|
-
* Writes every namespace's raw generated module, its augment overlay, and its
|
|
23
|
-
* barrel into a temporary store, emits the `package.json` and gi's own
|
|
24
|
-
* `node_modules/@gtkx/{ffi,gi}` symlinks — the self-referential `@gtkx/gi` link
|
|
25
|
-
* lets augment modules resolve sibling namespaces without relying on the
|
|
26
|
-
* project's top-level alias — swaps it into place, and points the visible
|
|
27
|
-
* `node_modules/@gtkx/gi` alias at it.
|
|
28
|
-
*
|
|
29
|
-
* @param options - Resolved store/link/dependency paths
|
|
30
|
-
* @param namespaces - Per-namespace raw module inputs
|
|
31
|
-
* @param fingerprint - Staleness sentinel written into the store, when provided
|
|
32
|
-
*/
|
|
33
|
-
export declare const writeGiStore: (options: GiStoreOptions, namespaces: readonly GiNamespaceInput[], fingerprint?: CodegenFingerprint) => void;
|
|
34
|
-
//# sourceMappingURL=gi-store.d.ts.map
|
package/dist/gi-store.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gi-store.d.ts","sourceRoot":"","sources":["../src/gi-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,kBAAkB,EAAwB,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,KAAK,YAAY,EAAc,MAAM,eAAe,CAAC;AAY9D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG;IACxC,sEAAsE;IACtE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAClC,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC,CAAC;AAsGF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,GACrB,SAAS,cAAc,EACvB,YAAY,SAAS,gBAAgB,EAAE,EACvC,cAAc,kBAAkB,KACjC,IA8CF,CAAC"}
|