@gtkx/codegen 1.0.0-rc.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/analysis/descriptor-render.d.ts +13 -9
- package/dist/analysis/descriptor-render.d.ts.map +1 -1
- package/dist/analysis/descriptor-render.js +80 -50
- package/dist/analysis/descriptor-render.js.map +1 -1
- package/dist/analysis/descriptor.d.ts +16 -7
- package/dist/analysis/descriptor.d.ts.map +1 -1
- package/dist/analysis/descriptor.js +15 -3
- package/dist/analysis/descriptor.js.map +1 -1
- package/dist/analysis/inheritance.d.ts +4 -3
- package/dist/analysis/inheritance.d.ts.map +1 -1
- package/dist/analysis/inheritance.js +103 -58
- package/dist/analysis/inheritance.js.map +1 -1
- package/dist/analysis/interface-conflicts.d.ts +23 -0
- package/dist/analysis/interface-conflicts.d.ts.map +1 -0
- package/dist/analysis/interface-conflicts.js +144 -0
- package/dist/analysis/interface-conflicts.js.map +1 -0
- package/dist/analysis/nul-terminated-bytes.d.ts +5 -0
- package/dist/analysis/nul-terminated-bytes.d.ts.map +1 -0
- package/dist/analysis/nul-terminated-bytes.js +18 -0
- package/dist/analysis/nul-terminated-bytes.js.map +1 -0
- package/dist/analysis/param-capability.d.ts +5 -0
- package/dist/analysis/param-capability.d.ts.map +1 -0
- package/dist/analysis/param-capability.js +129 -0
- package/dist/analysis/param-capability.js.map +1 -0
- package/dist/analysis/param-structure.d.ts +11 -4
- package/dist/analysis/param-structure.d.ts.map +1 -1
- package/dist/analysis/param-structure.js +42 -16
- package/dist/analysis/param-structure.js.map +1 -1
- package/dist/analysis/ts-type.d.ts.map +1 -1
- package/dist/analysis/ts-type.js +10 -17
- package/dist/analysis/ts-type.js.map +1 -1
- package/dist/analysis/type-key.d.ts +5 -0
- package/dist/analysis/type-key.d.ts.map +1 -0
- package/dist/analysis/type-key.js +9 -0
- package/dist/analysis/type-key.js.map +1 -0
- package/dist/analysis/type-shape.d.ts +8 -0
- package/dist/analysis/type-shape.d.ts.map +1 -0
- package/dist/analysis/type-shape.js +12 -0
- package/dist/analysis/type-shape.js.map +1 -0
- package/dist/compile.d.ts +12 -3
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +73 -24
- package/dist/compile.js.map +1 -1
- package/dist/docs/api-reference.d.ts +2 -2
- package/dist/docs/api-reference.d.ts.map +1 -1
- package/dist/docs/api-reference.js +17 -23
- package/dist/docs/api-reference.js.map +1 -1
- package/dist/docs/element-page.d.ts +4 -4
- package/dist/docs/element-page.d.ts.map +1 -1
- package/dist/docs/element-page.js +36 -22
- package/dist/docs/element-page.js.map +1 -1
- package/dist/docs/handwritten-props.d.ts +9 -0
- package/dist/docs/handwritten-props.d.ts.map +1 -0
- package/dist/docs/handwritten-props.js +149 -0
- package/dist/docs/handwritten-props.js.map +1 -0
- package/dist/docs/pipeline.d.ts.map +1 -1
- package/dist/docs/pipeline.js +87 -20
- package/dist/docs/pipeline.js.map +1 -1
- package/dist/docs/render.d.ts +26 -5
- package/dist/docs/render.d.ts.map +1 -1
- package/dist/docs/render.js +88 -25
- package/dist/docs/render.js.map +1 -1
- package/dist/docs/symbol-page.d.ts +17 -0
- package/dist/docs/symbol-page.d.ts.map +1 -1
- package/dist/docs/symbol-page.js +132 -44
- package/dist/docs/symbol-page.js.map +1 -1
- package/dist/fingerprint.d.ts +12 -1
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +44 -28
- package/dist/fingerprint.js.map +1 -1
- package/dist/gi.d.ts.map +1 -1
- package/dist/gi.js +1 -0
- package/dist/gi.js.map +1 -1
- package/dist/gir/ancestry.d.ts +8 -2
- package/dist/gir/ancestry.d.ts.map +1 -1
- package/dist/gir/ancestry.js +19 -1
- package/dist/gir/ancestry.js.map +1 -1
- package/dist/gir/annotations.d.ts +21 -0
- package/dist/gir/annotations.d.ts.map +1 -0
- package/dist/gir/annotations.js +15 -0
- package/dist/gir/annotations.js.map +1 -0
- package/dist/gir/callback.d.ts +1 -0
- package/dist/gir/callback.d.ts.map +1 -1
- package/dist/gir/callback.js +1 -0
- package/dist/gir/callback.js.map +1 -1
- package/dist/gir/class.d.ts +32 -1
- package/dist/gir/class.d.ts.map +1 -1
- package/dist/gir/class.js +8 -3
- package/dist/gir/class.js.map +1 -1
- package/dist/gir/cursor-overrides.d.ts +8 -0
- package/dist/gir/cursor-overrides.d.ts.map +1 -0
- package/dist/gir/cursor-overrides.js +6 -0
- package/dist/gir/cursor-overrides.js.map +1 -0
- package/dist/gir/emittable.d.ts +7 -0
- package/dist/gir/emittable.d.ts.map +1 -0
- package/dist/gir/emittable.js +3 -0
- package/dist/gir/emittable.js.map +1 -0
- package/dist/gir/enum.d.ts +21 -1
- package/dist/gir/enum.d.ts.map +1 -1
- package/dist/gir/enum.js +9 -9
- package/dist/gir/enum.js.map +1 -1
- package/dist/gir/field.d.ts +19 -3
- package/dist/gir/field.d.ts.map +1 -1
- package/dist/gir/field.js +7 -8
- package/dist/gir/field.js.map +1 -1
- package/dist/gir/function.d.ts +15 -0
- package/dist/gir/function.d.ts.map +1 -1
- package/dist/gir/function.js +28 -2
- package/dist/gir/function.js.map +1 -1
- package/dist/gir/libraries.d.ts +1 -3
- package/dist/gir/libraries.d.ts.map +1 -1
- package/dist/gir/libraries.js +0 -1
- package/dist/gir/libraries.js.map +1 -1
- package/dist/gir/library.d.ts +36 -0
- package/dist/gir/library.d.ts.map +1 -1
- package/dist/gir/library.js +35 -1
- package/dist/gir/library.js.map +1 -1
- package/dist/gir/namespace.d.ts +43 -1
- package/dist/gir/namespace.d.ts.map +1 -1
- package/dist/gir/namespace.js +8 -7
- package/dist/gir/namespace.js.map +1 -1
- package/dist/gir/parameter.d.ts +52 -1
- package/dist/gir/parameter.d.ts.map +1 -1
- package/dist/gir/parameter.js +8 -3
- package/dist/gir/parameter.js.map +1 -1
- package/dist/gir/parse.d.ts +3 -1
- package/dist/gir/parse.d.ts.map +1 -1
- package/dist/gir/parse.js +9 -9
- package/dist/gir/parse.js.map +1 -1
- package/dist/gir/primitives.d.ts +1 -0
- package/dist/gir/primitives.d.ts.map +1 -1
- package/dist/gir/primitives.js.map +1 -1
- package/dist/gir/property.d.ts +16 -0
- package/dist/gir/property.d.ts.map +1 -1
- package/dist/gir/property.js +3 -3
- package/dist/gir/property.js.map +1 -1
- package/dist/gir/record.d.ts +22 -0
- package/dist/gir/record.d.ts.map +1 -1
- package/dist/gir/record.js +3 -2
- package/dist/gir/record.js.map +1 -1
- package/dist/gir/size.d.ts +5 -4
- package/dist/gir/size.d.ts.map +1 -1
- package/dist/gir/size.js.map +1 -1
- package/dist/gir/type-id.d.ts +35 -0
- package/dist/gir/type-id.d.ts.map +1 -1
- package/dist/gir/type-id.js +1 -0
- package/dist/gir/type-id.js.map +1 -1
- package/dist/gir/type-ref.d.ts.map +1 -1
- package/dist/gir/type-ref.js +1 -0
- package/dist/gir/type-ref.js.map +1 -1
- package/dist/gir/type.d.ts +20 -0
- package/dist/gir/type.d.ts.map +1 -1
- package/dist/gir/type.js.map +1 -1
- package/dist/guards.d.ts +16 -0
- package/dist/guards.d.ts.map +1 -0
- package/dist/guards.js +11 -0
- package/dist/guards.js.map +1 -0
- package/dist/internal.d.ts +2 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -1
- package/dist/json.d.ts +3 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +11 -0
- package/dist/json.js.map +1 -0
- package/dist/khronos/args.d.ts +7 -6
- package/dist/khronos/args.d.ts.map +1 -1
- package/dist/khronos/args.js +28 -6
- package/dist/khronos/args.js.map +1 -1
- package/dist/khronos/doc-context.d.ts +29 -0
- package/dist/khronos/doc-context.d.ts.map +1 -0
- package/dist/khronos/doc-context.js +29 -0
- package/dist/khronos/doc-context.js.map +1 -0
- package/dist/khronos/extensions.d.ts +13 -0
- package/dist/khronos/extensions.d.ts.map +1 -0
- package/dist/khronos/extensions.js +49 -0
- package/dist/khronos/extensions.js.map +1 -0
- package/dist/khronos/jsdoc.d.ts +17 -11
- package/dist/khronos/jsdoc.d.ts.map +1 -1
- package/dist/khronos/jsdoc.js +104 -46
- package/dist/khronos/jsdoc.js.map +1 -1
- package/dist/khronos/model.d.ts +42 -3
- package/dist/khronos/model.d.ts.map +1 -1
- package/dist/khronos/model.js +218 -63
- package/dist/khronos/model.js.map +1 -1
- package/dist/khronos/modules.d.ts +9 -6
- package/dist/khronos/modules.d.ts.map +1 -1
- package/dist/khronos/modules.js +112 -27
- package/dist/khronos/modules.js.map +1 -1
- package/dist/khronos/notes.d.ts +19 -0
- package/dist/khronos/notes.d.ts.map +1 -0
- package/dist/khronos/notes.js +35 -0
- package/dist/khronos/notes.js.map +1 -0
- package/dist/khronos/param-pair.d.ts +1 -1
- package/dist/khronos/param-pair.d.ts.map +1 -1
- package/dist/khronos/param-pair.js.map +1 -1
- package/dist/khronos/parse.d.ts.map +1 -1
- package/dist/khronos/parse.js +3 -4
- package/dist/khronos/parse.js.map +1 -1
- package/dist/khronos/pipeline.d.ts +4 -2
- package/dist/khronos/pipeline.d.ts.map +1 -1
- package/dist/khronos/pipeline.js +58 -27
- package/dist/khronos/pipeline.js.map +1 -1
- package/dist/khronos/plan.d.ts +3 -9
- package/dist/khronos/plan.d.ts.map +1 -1
- package/dist/khronos/plan.js +3 -3
- package/dist/khronos/plan.js.map +1 -1
- package/dist/khronos/render.d.ts +8 -6
- package/dist/khronos/render.d.ts.map +1 -1
- package/dist/khronos/render.js +35 -26
- package/dist/khronos/render.js.map +1 -1
- package/dist/khronos/select.d.ts +21 -4
- package/dist/khronos/select.d.ts.map +1 -1
- package/dist/khronos/select.js +47 -34
- package/dist/khronos/select.js.map +1 -1
- package/dist/react/element-config.d.ts +2 -2
- package/dist/react/element-config.d.ts.map +1 -1
- package/dist/react/element-config.js.map +1 -1
- package/dist/runner.d.ts +6 -8
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +16 -0
- package/dist/runner.js.map +1 -1
- package/dist/staging.d.ts +5 -0
- package/dist/staging.d.ts.map +1 -0
- package/dist/staging.js +57 -0
- package/dist/staging.js.map +1 -0
- package/dist/store/compile-store.d.ts +1 -1
- package/dist/store/compile-store.d.ts.map +1 -1
- package/dist/store/compile-store.js +4 -2
- package/dist/store/compile-store.js.map +1 -1
- package/dist/store/gi/callable-doc.d.ts +11 -0
- package/dist/store/gi/callable-doc.d.ts.map +1 -0
- package/dist/store/gi/callable-doc.js +62 -0
- package/dist/store/gi/callable-doc.js.map +1 -0
- package/dist/store/gi/callables.d.ts +9 -2
- package/dist/store/gi/callables.d.ts.map +1 -1
- package/dist/store/gi/callables.js +35 -40
- package/dist/store/gi/callables.js.map +1 -1
- package/dist/store/gi/callback.d.ts.map +1 -1
- package/dist/store/gi/callback.js +10 -6
- package/dist/store/gi/callback.js.map +1 -1
- package/dist/store/gi/class.d.ts.map +1 -1
- package/dist/store/gi/class.js +63 -40
- package/dist/store/gi/class.js.map +1 -1
- package/dist/store/gi/closure-invocation.d.ts +4 -0
- package/dist/store/gi/closure-invocation.d.ts.map +1 -0
- package/dist/store/gi/closure-invocation.js +22 -0
- package/dist/store/gi/closure-invocation.js.map +1 -0
- package/dist/store/gi/companion.d.ts.map +1 -1
- package/dist/store/gi/companion.js +6 -6
- package/dist/store/gi/companion.js.map +1 -1
- package/dist/store/gi/constant.d.ts.map +1 -1
- package/dist/store/gi/constant.js +12 -3
- package/dist/store/gi/constant.js.map +1 -1
- package/dist/store/gi/constructor-props.d.ts.map +1 -1
- package/dist/store/gi/constructor-props.js +18 -20
- package/dist/store/gi/constructor-props.js.map +1 -1
- package/dist/store/gi/doc-spec.d.ts +14 -0
- package/dist/store/gi/doc-spec.d.ts.map +1 -0
- package/dist/store/gi/doc-spec.js +23 -0
- package/dist/store/gi/doc-spec.js.map +1 -0
- package/dist/store/gi/enum.d.ts.map +1 -1
- package/dist/store/gi/enum.js +52 -19
- package/dist/store/gi/enum.js.map +1 -1
- package/dist/store/gi/function.d.ts +1 -3
- package/dist/store/gi/function.d.ts.map +1 -1
- package/dist/store/gi/function.js +50 -29
- package/dist/store/gi/function.js.map +1 -1
- package/dist/store/gi/gtype-binding.d.ts.map +1 -1
- package/dist/store/gi/gtype-binding.js +4 -1
- package/dist/store/gi/gtype-binding.js.map +1 -1
- package/dist/store/gi/interface.d.ts.map +1 -1
- package/dist/store/gi/interface.js +155 -26
- package/dist/store/gi/interface.js.map +1 -1
- package/dist/store/gi/item-comparators.d.ts.map +1 -1
- package/dist/store/gi/item-comparators.js +3 -5
- package/dist/store/gi/item-comparators.js.map +1 -1
- package/dist/store/gi/method.d.ts +11 -2
- package/dist/store/gi/method.d.ts.map +1 -1
- package/dist/store/gi/method.js +80 -45
- package/dist/store/gi/method.js.map +1 -1
- package/dist/store/gi/param-marshal.d.ts +6 -2
- package/dist/store/gi/param-marshal.d.ts.map +1 -1
- package/dist/store/gi/param-marshal.js +54 -5
- package/dist/store/gi/param-marshal.js.map +1 -1
- package/dist/store/gi/pipeline.d.ts.map +1 -1
- package/dist/store/gi/pipeline.js +23 -11
- package/dist/store/gi/pipeline.js.map +1 -1
- package/dist/store/gi/properties.d.ts +2 -1
- package/dist/store/gi/properties.d.ts.map +1 -1
- package/dist/store/gi/properties.js +7 -4
- package/dist/store/gi/properties.js.map +1 -1
- package/dist/store/gi/property-accessor.d.ts +12 -5
- package/dist/store/gi/property-accessor.d.ts.map +1 -1
- package/dist/store/gi/property-accessor.js +98 -46
- package/dist/store/gi/property-accessor.js.map +1 -1
- package/dist/store/gi/record-constructor.d.ts +8 -1
- package/dist/store/gi/record-constructor.d.ts.map +1 -1
- package/dist/store/gi/record-constructor.js +34 -11
- package/dist/store/gi/record-constructor.js.map +1 -1
- package/dist/store/gi/record-field-accessor.d.ts +3 -1
- package/dist/store/gi/record-field-accessor.d.ts.map +1 -1
- package/dist/store/gi/record-field-accessor.js +8 -3
- package/dist/store/gi/record-field-accessor.js.map +1 -1
- package/dist/store/gi/record-layout.d.ts +6 -1
- package/dist/store/gi/record-layout.d.ts.map +1 -1
- package/dist/store/gi/record-layout.js +9 -2
- package/dist/store/gi/record-layout.js.map +1 -1
- package/dist/store/gi/record.d.ts.map +1 -1
- package/dist/store/gi/record.js +21 -9
- package/dist/store/gi/record.js.map +1 -1
- package/dist/store/gi/registration.d.ts +1 -1
- package/dist/store/gi/registration.js +4 -4
- package/dist/store/gi/registration.js.map +1 -1
- package/dist/store/gi/runtime-override.d.ts +2 -1
- package/dist/store/gi/runtime-override.d.ts.map +1 -1
- package/dist/store/gi/runtime-override.js +8 -5
- package/dist/store/gi/runtime-override.js.map +1 -1
- package/dist/store/gi/signal.d.ts +2 -1
- package/dist/store/gi/signal.d.ts.map +1 -1
- package/dist/store/gi/signal.js +42 -37
- package/dist/store/gi/signal.js.map +1 -1
- package/dist/store/gi/value-marshalable.d.ts +1 -2
- package/dist/store/gi/value-marshalable.d.ts.map +1 -1
- package/dist/store/gi/value-marshalable.js +3 -2
- package/dist/store/gi/value-marshalable.js.map +1 -1
- package/dist/store/gi/vtable.d.ts +19 -1
- package/dist/store/gi/vtable.d.ts.map +1 -1
- package/dist/store/gi/vtable.js +257 -51
- package/dist/store/gi/vtable.js.map +1 -1
- package/dist/store/gi-store.d.ts +1 -0
- package/dist/store/gi-store.d.ts.map +1 -1
- package/dist/store/gi-store.js +15 -20
- package/dist/store/gi-store.js.map +1 -1
- package/dist/store/jsx/element-components.d.ts +1 -1
- package/dist/store/jsx/element-components.d.ts.map +1 -1
- package/dist/store/jsx/element-components.js +6 -4
- package/dist/store/jsx/element-components.js.map +1 -1
- package/dist/store/jsx/element-prop-imports.d.ts +1 -3
- package/dist/store/jsx/element-prop-imports.d.ts.map +1 -1
- package/dist/store/jsx/element-prop-imports.js.map +1 -1
- package/dist/store/jsx/element-prop-types.d.ts +3 -0
- package/dist/store/jsx/element-prop-types.d.ts.map +1 -1
- package/dist/store/jsx/element-prop-types.js +7 -1
- package/dist/store/jsx/element-prop-types.js.map +1 -1
- package/dist/store/jsx/generated-elements.d.ts +2 -1
- package/dist/store/jsx/generated-elements.d.ts.map +1 -1
- package/dist/store/jsx/generated-elements.js +13 -7
- package/dist/store/jsx/generated-elements.js.map +1 -1
- package/dist/store/jsx/intrinsic-elements.d.ts +4 -0
- package/dist/store/jsx/intrinsic-elements.d.ts.map +1 -1
- package/dist/store/jsx/intrinsic-elements.js.map +1 -1
- package/dist/store/jsx/jsx.d.ts.map +1 -1
- package/dist/store/jsx/jsx.js +10 -9
- package/dist/store/jsx/jsx.js.map +1 -1
- package/dist/store/jsx/metadata.d.ts.map +1 -1
- package/dist/store/jsx/metadata.js +5 -3
- package/dist/store/jsx/metadata.js.map +1 -1
- package/dist/store/jsx/pipeline.d.ts +1 -1
- package/dist/store/jsx/pipeline.d.ts.map +1 -1
- package/dist/store/jsx/pipeline.js.map +1 -1
- package/dist/store/jsx/props.d.ts +1 -7
- package/dist/store/jsx/props.d.ts.map +1 -1
- package/dist/store/jsx/props.js +14 -6
- package/dist/store/jsx/props.js.map +1 -1
- package/dist/store/jsx-store.d.ts.map +1 -1
- package/dist/store/jsx-store.js +3 -3
- package/dist/store/jsx-store.js.map +1 -1
- package/dist/store/resolve-store.d.ts +14 -3
- package/dist/store/resolve-store.d.ts.map +1 -1
- package/dist/store/resolve-store.js +98 -15
- package/dist/store/resolve-store.js.map +1 -1
- package/dist/store/store-fs.d.ts +9 -6
- package/dist/store/store-fs.d.ts.map +1 -1
- package/dist/store/store-fs.js +59 -25
- package/dist/store/store-fs.js.map +1 -1
- package/dist/store/store-links.d.ts +3 -0
- package/dist/store/store-links.d.ts.map +1 -0
- package/dist/store/store-links.js +39 -0
- package/dist/store/store-links.js.map +1 -0
- package/dist/writer/comparison-context.d.ts +4 -0
- package/dist/writer/comparison-context.d.ts.map +1 -0
- package/dist/writer/comparison-context.js +13 -0
- package/dist/writer/comparison-context.js.map +1 -0
- package/dist/writer/context.d.ts +3 -2
- package/dist/writer/context.d.ts.map +1 -1
- package/dist/writer/context.js +11 -3
- package/dist/writer/context.js.map +1 -1
- package/dist/writer/doc-tags.d.ts +21 -0
- package/dist/writer/doc-tags.d.ts.map +1 -0
- package/dist/writer/doc-tags.js +38 -0
- package/dist/writer/doc-tags.js.map +1 -0
- package/dist/writer/doc.d.ts +3 -1
- package/dist/writer/doc.d.ts.map +1 -1
- package/dist/writer/doc.js +19 -6
- package/dist/writer/doc.js.map +1 -1
- package/dist/writer/gtk-doc.d.ts +1 -1
- package/dist/writer/gtk-doc.d.ts.map +1 -1
- package/dist/writer/gtk-doc.js +64 -15
- package/dist/writer/gtk-doc.js.map +1 -1
- package/dist/writer/module.d.ts +17 -3
- package/dist/writer/module.d.ts.map +1 -1
- package/dist/writer/module.js +72 -3
- package/dist/writer/module.js.map +1 -1
- package/dist/xml.d.ts +7 -1
- package/dist/xml.d.ts.map +1 -1
- package/dist/xml.js +43 -1
- package/dist/xml.js.map +1 -1
- package/overrides/gdk/rgba.ts.ejs +26 -0
- package/overrides/gobject/object.ts.ejs +48 -3
- package/overrides/gobject/value.ts.ejs +7 -0
- package/overrides/graphene/structs.ts.ejs +55 -0
- package/package.json +15 -4
- package/src/analysis/descriptor-render.ts +130 -66
- package/src/analysis/descriptor.ts +35 -11
- package/src/analysis/inheritance.ts +166 -75
- package/src/analysis/interface-conflicts.ts +237 -0
- package/src/analysis/nul-terminated-bytes.ts +31 -0
- package/src/analysis/param-capability.ts +169 -0
- package/src/analysis/param-structure.ts +85 -25
- package/src/analysis/ts-type.ts +13 -17
- package/src/analysis/type-key.ts +14 -0
- package/src/analysis/type-shape.ts +24 -0
- package/src/compile.ts +110 -26
- package/src/docs/api-reference.ts +46 -34
- package/src/docs/element-page.ts +58 -49
- package/src/docs/handwritten-props.ts +230 -0
- package/src/docs/pipeline.ts +131 -21
- package/src/docs/render.ts +153 -35
- package/src/docs/symbol-page.ts +230 -80
- package/src/fingerprint.ts +86 -32
- package/src/gi.ts +1 -0
- package/src/gir/ancestry.ts +31 -1
- package/src/gir/annotations.ts +37 -0
- package/src/gir/callback.ts +2 -0
- package/src/gir/class.ts +42 -4
- package/src/gir/cursor-overrides.ts +12 -0
- package/src/gir/emittable.ts +8 -0
- package/src/gir/enum.ts +30 -10
- package/src/gir/field.ts +24 -9
- package/src/gir/function.ts +60 -9
- package/src/gir/libraries.ts +11 -3
- package/src/gir/library.ts +52 -3
- package/src/gir/namespace.ts +49 -7
- package/src/gir/parameter.ts +62 -3
- package/src/gir/parse.ts +13 -9
- package/src/gir/primitives.ts +1 -0
- package/src/gir/property.ts +18 -3
- package/src/gir/record.ts +24 -2
- package/src/gir/size.ts +8 -3
- package/src/gir/type-id.ts +49 -3
- package/src/gir/type-ref.ts +1 -0
- package/src/gir/type.ts +50 -6
- package/src/guards.ts +23 -0
- package/src/internal.ts +2 -0
- package/src/json.ts +11 -0
- package/src/khronos/args.ts +36 -13
- package/src/khronos/doc-context.ts +62 -0
- package/src/khronos/extensions.ts +85 -0
- package/src/khronos/jsdoc.ts +152 -56
- package/src/khronos/model.ts +314 -69
- package/src/khronos/modules.ts +150 -40
- package/src/khronos/notes.ts +74 -0
- package/src/khronos/param-pair.ts +1 -1
- package/src/khronos/parse.ts +3 -4
- package/src/khronos/pipeline.ts +95 -42
- package/src/khronos/plan.ts +4 -6
- package/src/khronos/render.ts +62 -50
- package/src/khronos/select.ts +91 -50
- package/src/react/element-config.ts +2 -2
- package/src/runner.ts +20 -9
- package/src/staging.ts +69 -0
- package/src/store/compile-store.ts +7 -5
- package/src/store/gi/callable-doc.ts +102 -0
- package/src/store/gi/callables.ts +58 -44
- package/src/store/gi/callback.ts +10 -9
- package/src/store/gi/class.ts +83 -49
- package/src/store/gi/closure-invocation.ts +26 -0
- package/src/store/gi/companion.ts +7 -6
- package/src/store/gi/constant.ts +14 -5
- package/src/store/gi/constructor-props.ts +19 -23
- package/src/store/gi/doc-spec.ts +38 -0
- package/src/store/gi/enum.ts +75 -26
- package/src/store/gi/function.ts +72 -44
- package/src/store/gi/gtype-binding.ts +7 -2
- package/src/store/gi/interface.ts +244 -37
- package/src/store/gi/item-comparators.ts +3 -5
- package/src/store/gi/method.ts +124 -69
- package/src/store/gi/param-marshal.ts +91 -6
- package/src/store/gi/pipeline.ts +28 -13
- package/src/store/gi/properties.ts +10 -5
- package/src/store/gi/property-accessor.ts +163 -75
- package/src/store/gi/record-constructor.ts +56 -19
- package/src/store/gi/record-field-accessor.ts +13 -4
- package/src/store/gi/record-layout.ts +12 -2
- package/src/store/gi/record.ts +24 -10
- package/src/store/gi/registration.ts +5 -5
- package/src/store/gi/runtime-override.ts +13 -6
- package/src/store/gi/signal.ts +54 -57
- package/src/store/gi/value-marshalable.ts +4 -2
- package/src/store/gi/vtable.ts +439 -61
- package/src/store/gi-store.ts +26 -31
- package/src/store/jsx/element-components.ts +8 -5
- package/src/store/jsx/element-prop-imports.ts +1 -3
- package/src/store/jsx/element-prop-types.ts +10 -1
- package/src/store/jsx/generated-elements.ts +17 -8
- package/src/store/jsx/intrinsic-elements.ts +4 -0
- package/src/store/jsx/jsx.ts +11 -9
- package/src/store/jsx/metadata.ts +6 -3
- package/src/store/jsx/pipeline.ts +1 -1
- package/src/store/jsx/props.ts +20 -7
- package/src/store/jsx-store.ts +3 -3
- package/src/store/resolve-store.ts +133 -18
- package/src/store/store-fs.ts +87 -34
- package/src/store/store-links.ts +49 -0
- package/src/writer/comparison-context.ts +18 -0
- package/src/writer/context.ts +14 -4
- package/src/writer/doc-tags.ts +70 -0
- package/src/writer/doc.ts +29 -6
- package/src/writer/gtk-doc.ts +82 -15
- package/src/writer/module.ts +114 -4
- package/src/xml.ts +61 -1
package/src/docs/symbol-page.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sanitizeTypeIdentifier, sortStringsBy, upperFirst } from "@gtkx/utils";
|
|
2
|
+
import type { GirAnnotations } from "../gir/annotations.js";
|
|
2
3
|
import type { GirClass } from "../gir/class.js";
|
|
3
|
-
import type { GirEnum } from "../gir/enum.js";
|
|
4
|
+
import type { EnumMember, GirEnum } from "../gir/enum.js";
|
|
4
5
|
import type { GirFunction } from "../gir/function.js";
|
|
5
6
|
import type { Library } from "../gir/library.js";
|
|
6
|
-
import type { GirProperty } from "../gir/property.js";
|
|
7
7
|
import type { GirRecord } from "../gir/record.js";
|
|
8
8
|
import type { ModuleContext } from "../writer/context.js";
|
|
9
|
+
import type { JsDocSpec } from "../writer/doc.js";
|
|
9
10
|
import { reservedSignalMemberRename } from "../analysis/inheritance.js";
|
|
10
11
|
import { renderTsType } from "../analysis/ts-type.js";
|
|
11
12
|
import { ancestorChain } from "../gir/ancestry.js";
|
|
12
13
|
import { callbackAsFunction, type GirCallback } from "../gir/callback.js";
|
|
13
14
|
import { type GirAlias, type GirConstant, type GirNamespace, namespaceDirectory } from "../gir/namespace.js";
|
|
14
15
|
import { PRIMITIVE_TS_TYPE, primitiveCategory } from "../gir/primitives.js";
|
|
16
|
+
import { callableSpec } from "../store/gi/callable-doc.js";
|
|
15
17
|
import {
|
|
16
18
|
dedupeCallables,
|
|
17
19
|
indexMethodsByName,
|
|
@@ -21,6 +23,7 @@ import {
|
|
|
21
23
|
renderStaticSignature,
|
|
22
24
|
} from "../store/gi/callables.js";
|
|
23
25
|
import { constantLiteral } from "../store/gi/constant.js";
|
|
26
|
+
import { annotationSpec } from "../store/gi/doc-spec.js";
|
|
24
27
|
import { enumMemberKey } from "../store/gi/enum.js";
|
|
25
28
|
import {
|
|
26
29
|
methodExportName,
|
|
@@ -31,22 +34,32 @@ import {
|
|
|
31
34
|
import { resolveAccessor, type ResolvedAccessor } from "../store/gi/property-accessor.js";
|
|
32
35
|
import { resolveRecordFieldEntry } from "../store/gi/record-field-accessor.js";
|
|
33
36
|
import { computeRecordFieldSlots } from "../store/gi/record-layout.js";
|
|
37
|
+
import { vfuncEntries } from "../store/gi/vtable.js";
|
|
34
38
|
import { implementedInterfaces, newlyImplementedInterfaces } from "../store/jsx/intrinsic-elements.js";
|
|
35
39
|
import {
|
|
40
|
+
annotationNotes,
|
|
36
41
|
classMethodEntries,
|
|
42
|
+
deprecationMeta,
|
|
37
43
|
docMarkdown,
|
|
38
|
-
docsDefaultValue,
|
|
39
44
|
docsSignatureContext,
|
|
40
45
|
firstSentence,
|
|
41
46
|
implementsLine,
|
|
42
47
|
joinSections,
|
|
43
|
-
|
|
48
|
+
type MetaDocEntry,
|
|
44
49
|
methodsSectionBlocks,
|
|
45
50
|
originSignatureBlocks,
|
|
51
|
+
type OriginSignatureEntry,
|
|
52
|
+
plainText,
|
|
53
|
+
propertyMetaLine,
|
|
54
|
+
qualifiedClassName,
|
|
46
55
|
renderDocsSignalHandlerType,
|
|
47
56
|
renderDocsType,
|
|
57
|
+
signalTags,
|
|
48
58
|
signatureBlock,
|
|
49
59
|
type SignatureEntry,
|
|
60
|
+
signatureEntryBlock,
|
|
61
|
+
sortedMetaBlocks,
|
|
62
|
+
tagNotes,
|
|
50
63
|
} from "./render.js";
|
|
51
64
|
|
|
52
65
|
/** What every indexed GIR symbol carries, whatever its kind. */
|
|
@@ -61,16 +74,57 @@ type GiSymbolBase = {
|
|
|
61
74
|
|
|
62
75
|
/** A GIR symbol the reference indexes, discriminated by `kind` and carrying the GIR node its page renders from. */
|
|
63
76
|
type GiSymbolEntry =
|
|
64
|
-
| (GiSymbolBase & {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
(GiSymbolBase & {
|
|
77
|
+
| (GiSymbolBase & {
|
|
78
|
+
/** Renders the class page: hierarchy, constructors, static methods, properties, signals, and methods. */
|
|
79
|
+
kind: "class" | "interface";
|
|
80
|
+
/** Supplies the ancestry, members, and, on an interface, the vtable slots an implementer fills. */
|
|
81
|
+
klass: GirClass;
|
|
82
|
+
}) |
|
|
83
|
+
(GiSymbolBase & {
|
|
84
|
+
/** Renders the record page, labeled `union` when the record is one. */
|
|
85
|
+
kind: "record";
|
|
86
|
+
/** Supplies the constructors, static methods, fields, and instance methods. */
|
|
87
|
+
record: GirRecord;
|
|
88
|
+
}) |
|
|
89
|
+
(GiSymbolBase & {
|
|
90
|
+
/** Renders the page for an enumeration, a flags type, or an error domain, as a table of members. */
|
|
91
|
+
kind: "enum";
|
|
92
|
+
/** Supplies the members, their values, and the GError domain when the enum carries one. */
|
|
93
|
+
enumeration: GirEnum;
|
|
94
|
+
}) |
|
|
95
|
+
(GiSymbolBase & {
|
|
96
|
+
/** Renders the callback page as a single function type signature. */
|
|
97
|
+
kind: "callback";
|
|
98
|
+
/** Supplies the parameters and return type the signature is rendered from. */
|
|
99
|
+
callback: GirCallback;
|
|
100
|
+
}) |
|
|
101
|
+
(GiSymbolBase & {
|
|
102
|
+
/** Renders the alias page as the type the alias resolves to. */
|
|
103
|
+
kind: "alias";
|
|
104
|
+
/** Supplies the target type the page prints. */
|
|
105
|
+
alias: GirAlias;
|
|
106
|
+
}) |
|
|
107
|
+
(GiSymbolBase & {
|
|
108
|
+
/** Renders the page for a namespace-level function, promisified when a finish function matches it. */
|
|
109
|
+
kind: "function";
|
|
110
|
+
/** Supplies the parameters and return type the signature is rendered from. */
|
|
111
|
+
fn: GirFunction;
|
|
112
|
+
}) |
|
|
113
|
+
(GiSymbolBase & {
|
|
114
|
+
/** Renders the page for a namespace-level constant, showing its type and literal value. */
|
|
115
|
+
kind: "constant";
|
|
116
|
+
/** Supplies the type and the value the literal is emitted from. */
|
|
117
|
+
constant: GirConstant;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
type ClassSymbol = GiSymbolBase & { klass: GirClass };
|
|
121
|
+
type ClassPageSymbol = ClassSymbol & { kind: "class" | "interface" };
|
|
71
122
|
|
|
123
|
+
/** What {@link renderSymbolPage} needs besides the entry itself. */
|
|
72
124
|
type SymbolPageOptions = {
|
|
125
|
+
/** Parsed GIR the page resolves ancestry, interfaces, and referenced types against. */
|
|
73
126
|
library: Library;
|
|
127
|
+
/** Looks up the JSX element a class is also available as, undefined when it has none. */
|
|
74
128
|
elementNameFor: (namespaceName: string, className: string) => string | undefined;
|
|
75
129
|
};
|
|
76
130
|
|
|
@@ -95,11 +149,10 @@ type PropertyAccessorSetup = {
|
|
|
95
149
|
methodByName: Map<string, GirFunction>;
|
|
96
150
|
};
|
|
97
151
|
|
|
98
|
-
type MetaDocEntry = { name: string; meta: string; doc: string };
|
|
99
|
-
type SignalDocEntry = { name: string; signature: string; doc: string; origin: string | undefined };
|
|
100
152
|
type ResolvedRecordField = NonNullable<ReturnType<typeof resolveRecordFieldEntry>>;
|
|
101
153
|
|
|
102
154
|
const qualifiedName = (entry: GiSymbolBase): string => `${entry.namespace.name}.${entry.name}`;
|
|
155
|
+
const pageTagNotes = (spec: JsDocSpec): string[] => tagNotes({ ...spec, deprecated: undefined, since: undefined });
|
|
103
156
|
|
|
104
157
|
const frontmatter = (entry: GiSymbolBase, kindLabel: string): string => {
|
|
105
158
|
const sentence = firstSentence(entry.doc);
|
|
@@ -114,18 +167,43 @@ const kindLine = (kindLabel: string, namespace: GirNamespace): string =>
|
|
|
114
167
|
const importBlock = (entry: GiSymbolBase): string =>
|
|
115
168
|
`\`\`\`ts\nimport * as ${entry.namespace.name} from "@gtkx/gi/${namespaceDirectory(entry.namespace)}";\n\`\`\``;
|
|
116
169
|
|
|
170
|
+
const entryAnnotations = (entry: GiSymbolEntry): GirAnnotations => {
|
|
171
|
+
switch (entry.kind) {
|
|
172
|
+
case "class":
|
|
173
|
+
case "interface": {
|
|
174
|
+
return entry.klass.annotations;
|
|
175
|
+
}
|
|
176
|
+
case "record": {
|
|
177
|
+
return entry.record.annotations;
|
|
178
|
+
}
|
|
179
|
+
case "enum": {
|
|
180
|
+
return entry.enumeration.annotations;
|
|
181
|
+
}
|
|
182
|
+
case "callback": {
|
|
183
|
+
return entry.callback.annotations;
|
|
184
|
+
}
|
|
185
|
+
case "alias": {
|
|
186
|
+
return entry.alias.annotations;
|
|
187
|
+
}
|
|
188
|
+
case "function": {
|
|
189
|
+
return entry.fn.annotations;
|
|
190
|
+
}
|
|
191
|
+
case "constant": {
|
|
192
|
+
return entry.constant.annotations;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
117
197
|
const pageHeader = (entry: GiSymbolEntry, kindLabel: string): string[] => [
|
|
118
198
|
frontmatter(entry, kindLabel),
|
|
119
199
|
`# ${qualifiedName(entry)}`,
|
|
120
200
|
kindLine(kindLabel, entry.namespace),
|
|
121
201
|
docMarkdown(entry.doc),
|
|
202
|
+
...annotationNotes(entryAnnotations(entry)),
|
|
122
203
|
importBlock(entry),
|
|
123
204
|
];
|
|
124
205
|
|
|
125
|
-
const
|
|
126
|
-
`${namespaceName}.${pascalCase(className)}`;
|
|
127
|
-
|
|
128
|
-
const elementNote = (entry: GiSymbolBase & { klass: GirClass }, options: SymbolPageOptions): string[] => {
|
|
206
|
+
const elementNote = (entry: ClassSymbol, options: SymbolPageOptions): string[] => {
|
|
129
207
|
const glibName = options.elementNameFor(entry.namespace.name, entry.klass.name);
|
|
130
208
|
|
|
131
209
|
if (glibName === undefined) {
|
|
@@ -139,7 +217,7 @@ const elementNote = (entry: GiSymbolBase & { klass: GirClass }, options: SymbolP
|
|
|
139
217
|
];
|
|
140
218
|
};
|
|
141
219
|
|
|
142
|
-
const hierarchySection = (entry:
|
|
220
|
+
const hierarchySection = (entry: ClassSymbol, library: Library): string[] => {
|
|
143
221
|
const ancestors = [...ancestorChain(library, entry.klass, entry.namespace.name)].slice(1).toReversed();
|
|
144
222
|
|
|
145
223
|
const interfaces = implementedInterfaces(entry.klass, entry.namespace, library).map((iface) =>
|
|
@@ -166,7 +244,7 @@ const hierarchySection = (entry: GiSymbolBase & { klass: GirClass }, library: Li
|
|
|
166
244
|
return lines;
|
|
167
245
|
};
|
|
168
246
|
|
|
169
|
-
const prerequisitesLine = (entry:
|
|
247
|
+
const prerequisitesLine = (entry: ClassSymbol, library: Library): string[] => {
|
|
170
248
|
const names = entry.klass.prerequisites.map((name) => {
|
|
171
249
|
const resolved = library.resolveType(entry.namespace.name, name);
|
|
172
250
|
|
|
@@ -184,33 +262,86 @@ const prerequisitesLine = (entry: GiSymbolBase & { klass: GirClass }, library: L
|
|
|
184
262
|
return [`Requires ${names.join(", ")}.`];
|
|
185
263
|
};
|
|
186
264
|
|
|
265
|
+
const interfaceImplementingIntro = (entry: ClassSymbol): string => {
|
|
266
|
+
const qualified = qualifiedName(entry);
|
|
267
|
+
|
|
268
|
+
return (
|
|
269
|
+
`A class fills these vtable slots to adopt the interface: declare \`implements ${qualified}Impl\` ` +
|
|
270
|
+
`on it and pass \`${qualified}\` in the \`implements\` option of \`registerClass\`. Every slot is ` +
|
|
271
|
+
"optional, and one the class leaves out keeps whatever the interface installs by default. The " +
|
|
272
|
+
"methods, properties, and signals above come from GLib dispatch."
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
const classImplementingIntro = (entry: ClassSymbol): string => {
|
|
277
|
+
const qualified = qualifiedName(entry);
|
|
278
|
+
|
|
279
|
+
return (
|
|
280
|
+
"A subclass declared with `registerClass` overrides these virtual methods to change what " +
|
|
281
|
+
`\`${qualified}\` does: define the slot as a method on the subclass and call \`super.<slot>(...)\` ` +
|
|
282
|
+
"to chain up to the inherited implementation. A slot the subclass leaves out keeps that " +
|
|
283
|
+
"implementation unchanged."
|
|
284
|
+
);
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const implementingIntro = (entry: ClassPageSymbol): string =>
|
|
288
|
+
entry.kind === "interface" ? interfaceImplementingIntro(entry) : classImplementingIntro(entry);
|
|
289
|
+
|
|
290
|
+
const implementingSection = (entry: ClassPageSymbol, library: Library): string[] => {
|
|
291
|
+
const context = docsSignatureContext(entry.namespace, library);
|
|
292
|
+
const entries = vfuncEntries(context, entry.namespace.name, entry.klass);
|
|
293
|
+
|
|
294
|
+
if (entries.length === 0) {
|
|
295
|
+
return [];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const blocks = sortStringsBy(entries, (item) => item.name).map((item) =>
|
|
299
|
+
signatureBlock(item.name, item.signature, [docMarkdown(item.doc)]));
|
|
300
|
+
|
|
301
|
+
return ["## Implementing", implementingIntro(entry), ...blocks];
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
const staticEntry = (options: StaticSectionOptions, callable: GirFunction): SignatureEntry | undefined => {
|
|
305
|
+
const signature = renderStaticSignature(options.context, callable, {
|
|
306
|
+
returnTypeOverride: options.returnTypeOverride,
|
|
307
|
+
siblings: options.siblings,
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
if (signature === undefined) {
|
|
311
|
+
return undefined;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const finishFn = matchStaticFinishFunction(options.context, callable, options.siblings);
|
|
315
|
+
|
|
316
|
+
return {
|
|
317
|
+
name: signature.name,
|
|
318
|
+
signature: signature.signature,
|
|
319
|
+
doc: docMarkdown(callable.doc),
|
|
320
|
+
tags: callableSpec(options.context, callable, { finishFn }),
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
|
|
187
324
|
const staticSection = (options: StaticSectionOptions): string[] => {
|
|
188
|
-
const
|
|
325
|
+
const entries: SignatureEntry[] = [];
|
|
189
326
|
|
|
190
327
|
for (const callable of dedupeCallables(options.callables)) {
|
|
191
|
-
const
|
|
192
|
-
returnTypeOverride: options.returnTypeOverride,
|
|
193
|
-
siblings: options.siblings,
|
|
194
|
-
});
|
|
328
|
+
const entry = staticEntry(options, callable);
|
|
195
329
|
|
|
196
|
-
if (
|
|
197
|
-
|
|
330
|
+
if (entry !== undefined) {
|
|
331
|
+
entries.push(entry);
|
|
198
332
|
}
|
|
199
|
-
|
|
200
|
-
rendered.push({
|
|
201
|
-
name: signature.name,
|
|
202
|
-
block: signatureBlock(signature.name, signature.signature, [docMarkdown(callable.doc)]),
|
|
203
|
-
});
|
|
204
333
|
}
|
|
205
334
|
|
|
206
|
-
if (
|
|
335
|
+
if (entries.length === 0) {
|
|
207
336
|
return [];
|
|
208
337
|
}
|
|
209
338
|
|
|
210
|
-
|
|
339
|
+
const blocks = sortStringsBy(entries, (item) => item.name).map((item) => signatureEntryBlock(item));
|
|
340
|
+
|
|
341
|
+
return [options.title, options.intro, ...blocks];
|
|
211
342
|
};
|
|
212
343
|
|
|
213
|
-
const memberOwners = (entry:
|
|
344
|
+
const memberOwners = (entry: ClassSymbol, library: Library): MemberOwner[] => [
|
|
214
345
|
{ klass: entry.klass, namespace: entry.namespace, origin: undefined },
|
|
215
346
|
...newlyImplementedInterfaces(entry.klass, entry.namespace, library).map((iface) => ({
|
|
216
347
|
klass: iface.klass,
|
|
@@ -221,7 +352,7 @@ const memberOwners = (entry: GiSymbolBase & { klass: GirClass }, library: Librar
|
|
|
221
352
|
|
|
222
353
|
const interfaceMethodNames = (library: Library, owner: MemberOwner): string[] => {
|
|
223
354
|
const context = docsSignatureContext(owner.namespace, library);
|
|
224
|
-
const className =
|
|
355
|
+
const className = sanitizeTypeIdentifier(owner.klass.name);
|
|
225
356
|
const methods = dedupeCallables(owner.klass.methods);
|
|
226
357
|
|
|
227
358
|
const scope = instanceScope(className, {
|
|
@@ -264,32 +395,20 @@ const propertyAccessorSetup = (
|
|
|
264
395
|
};
|
|
265
396
|
};
|
|
266
397
|
|
|
267
|
-
const
|
|
268
|
-
const meta: string[] = [`\`${accessor.tsType}\``];
|
|
269
|
-
|
|
270
|
-
if (property.defaultValue !== undefined) {
|
|
271
|
-
meta.push(`default \`${docsDefaultValue(property.defaultValue)}\``);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
if (property.constructOnly) {
|
|
275
|
-
meta.push("construct-only");
|
|
276
|
-
}
|
|
277
|
-
|
|
398
|
+
const getAccessNotes = (accessor: ResolvedAccessor): string[] => {
|
|
278
399
|
if (!accessor.isWritable) {
|
|
279
|
-
|
|
280
|
-
} else if (!accessor.hasGetter) {
|
|
281
|
-
meta.push("write-only");
|
|
400
|
+
return ["read-only"];
|
|
282
401
|
}
|
|
283
402
|
|
|
284
|
-
if (
|
|
285
|
-
|
|
403
|
+
if (!accessor.hasGetter) {
|
|
404
|
+
return ["write-only"];
|
|
286
405
|
}
|
|
287
406
|
|
|
288
|
-
return
|
|
407
|
+
return accessor.readType === accessor.writeType ? [] : [`writes \`${accessor.writeType}\``];
|
|
289
408
|
};
|
|
290
409
|
|
|
291
|
-
const
|
|
292
|
-
|
|
410
|
+
const documentedAccessorType = (accessor: ResolvedAccessor): string =>
|
|
411
|
+
accessor.hasGetter ? accessor.readType : accessor.writeType;
|
|
293
412
|
|
|
294
413
|
const ownerPropertyEntries = (owner: MemberOwner, setup: PropertyAccessorSetup, seen: Set<string>): MetaDocEntry[] => {
|
|
295
414
|
const entries: MetaDocEntry[] = [];
|
|
@@ -310,18 +429,21 @@ const ownerPropertyEntries = (owner: MemberOwner, setup: PropertyAccessorSetup,
|
|
|
310
429
|
|
|
311
430
|
entries.push({
|
|
312
431
|
name: accessor.jsName,
|
|
313
|
-
meta:
|
|
432
|
+
meta: propertyMetaLine({
|
|
433
|
+
type: documentedAccessorType(accessor),
|
|
434
|
+
property,
|
|
435
|
+
accessNotes: getAccessNotes(accessor),
|
|
436
|
+
origin: owner.origin,
|
|
437
|
+
}),
|
|
314
438
|
doc: docMarkdown(property.doc),
|
|
439
|
+
tags: annotationSpec(property.annotations),
|
|
315
440
|
});
|
|
316
441
|
}
|
|
317
442
|
|
|
318
443
|
return entries;
|
|
319
444
|
};
|
|
320
445
|
|
|
321
|
-
const propertiesSection = (
|
|
322
|
-
entry: GiSymbolBase & { kind: "class" | "interface"; klass: GirClass },
|
|
323
|
-
library: Library,
|
|
324
|
-
): string[] => {
|
|
446
|
+
const propertiesSection = (entry: ClassPageSymbol, library: Library): string[] => {
|
|
325
447
|
const seen: Set<string> = new Set();
|
|
326
448
|
const entries: MetaDocEntry[] = [];
|
|
327
449
|
|
|
@@ -343,8 +465,8 @@ const propertiesSection = (
|
|
|
343
465
|
return ["## Properties", intro, ...sortedMetaBlocks(entries)];
|
|
344
466
|
};
|
|
345
467
|
|
|
346
|
-
const ownerSignalEntries = (owner: MemberOwner, library: Library, seen: Set<string>):
|
|
347
|
-
const entries:
|
|
468
|
+
const ownerSignalEntries = (owner: MemberOwner, library: Library, seen: Set<string>): OriginSignatureEntry[] => {
|
|
469
|
+
const entries: OriginSignatureEntry[] = [];
|
|
348
470
|
|
|
349
471
|
for (const signal of owner.klass.signals) {
|
|
350
472
|
if (seen.has(signal.name)) {
|
|
@@ -357,6 +479,7 @@ const ownerSignalEntries = (owner: MemberOwner, library: Library, seen: Set<stri
|
|
|
357
479
|
name: signal.name,
|
|
358
480
|
signature: renderDocsSignalHandlerType(library, signal),
|
|
359
481
|
doc: docMarkdown(signal.doc),
|
|
482
|
+
tags: signalTags(signal, false),
|
|
360
483
|
origin: owner.origin,
|
|
361
484
|
});
|
|
362
485
|
}
|
|
@@ -364,9 +487,9 @@ const ownerSignalEntries = (owner: MemberOwner, library: Library, seen: Set<stri
|
|
|
364
487
|
return entries;
|
|
365
488
|
};
|
|
366
489
|
|
|
367
|
-
const signalsSection = (entry:
|
|
490
|
+
const signalsSection = (entry: ClassSymbol, library: Library): string[] => {
|
|
368
491
|
const seen: Set<string> = new Set();
|
|
369
|
-
const entries:
|
|
492
|
+
const entries: OriginSignatureEntry[] = [];
|
|
370
493
|
|
|
371
494
|
for (const owner of memberOwners(entry, library)) {
|
|
372
495
|
entries.push(...ownerSignalEntries(owner, library, seen));
|
|
@@ -383,16 +506,13 @@ const signalsSection = (entry: GiSymbolBase & { klass: GirClass }, library: Libr
|
|
|
383
506
|
return ["## Signals", intro, ...originSignatureBlocks(entries)];
|
|
384
507
|
};
|
|
385
508
|
|
|
386
|
-
const classMethodsSection = (entry:
|
|
509
|
+
const classMethodsSection = (entry: ClassSymbol, library: Library): string[] =>
|
|
387
510
|
methodsSectionBlocks(
|
|
388
511
|
classMethodEntries(library, entry.namespace, entry.klass),
|
|
389
512
|
"Methods are called on instances. Methods inherited from ancestors are documented on their own pages.",
|
|
390
513
|
);
|
|
391
514
|
|
|
392
|
-
const classPage = (
|
|
393
|
-
entry: GiSymbolBase & { kind: "class" | "interface"; klass: GirClass },
|
|
394
|
-
options: SymbolPageOptions,
|
|
395
|
-
): string => {
|
|
515
|
+
const classPage = (entry: ClassPageSymbol, options: SymbolPageOptions): string => {
|
|
396
516
|
const { library } = options;
|
|
397
517
|
const qualified = qualifiedName(entry);
|
|
398
518
|
const docsContext = docsSignatureContext(entry.namespace, library);
|
|
@@ -422,6 +542,7 @@ const classPage = (
|
|
|
422
542
|
...propertiesSection(entry, library),
|
|
423
543
|
...signalsSection(entry, library),
|
|
424
544
|
...classMethodsSection(entry, library),
|
|
545
|
+
...implementingSection(entry, library),
|
|
425
546
|
]);
|
|
426
547
|
};
|
|
427
548
|
|
|
@@ -462,7 +583,12 @@ const recordInstanceEntries = (context: ModuleContext, record: GirRecord): Signa
|
|
|
462
583
|
continue;
|
|
463
584
|
}
|
|
464
585
|
|
|
465
|
-
entries.push({
|
|
586
|
+
entries.push({
|
|
587
|
+
name: rendered.name,
|
|
588
|
+
signature: rendered.signature,
|
|
589
|
+
doc: docMarkdown(callable.doc),
|
|
590
|
+
tags: callableSpec(context, callable, {}),
|
|
591
|
+
});
|
|
466
592
|
}
|
|
467
593
|
|
|
468
594
|
return sortStringsBy(entries, (item) => item.name);
|
|
@@ -500,7 +626,11 @@ const recordPage = (entry: GiSymbolBase & { kind: "record"; record: GirRecord },
|
|
|
500
626
|
};
|
|
501
627
|
|
|
502
628
|
const fieldMeta = (field: ResolvedRecordField): string =>
|
|
503
|
-
[
|
|
629
|
+
[
|
|
630
|
+
`\`${field.tsType}\``,
|
|
631
|
+
...(field.isWritable ? [] : ["read-only"]),
|
|
632
|
+
...deprecationMeta(field.annotations),
|
|
633
|
+
].join(" · ");
|
|
504
634
|
|
|
505
635
|
const fieldsSection = (record: GirRecord, context: ModuleContext, claimedNames: Set<string>): string[] => {
|
|
506
636
|
const { slots } = computeRecordFieldSlots(context, record.fields, record.isUnion);
|
|
@@ -513,7 +643,12 @@ const fieldsSection = (record: GirRecord, context: ModuleContext, claimedNames:
|
|
|
513
643
|
continue;
|
|
514
644
|
}
|
|
515
645
|
|
|
516
|
-
entries.push({
|
|
646
|
+
entries.push({
|
|
647
|
+
name: field.jsName,
|
|
648
|
+
meta: fieldMeta(field),
|
|
649
|
+
doc: docMarkdown(field.doc),
|
|
650
|
+
tags: annotationSpec(field.annotations),
|
|
651
|
+
});
|
|
517
652
|
}
|
|
518
653
|
|
|
519
654
|
if (entries.length === 0) {
|
|
@@ -523,16 +658,23 @@ const fieldsSection = (record: GirRecord, context: ModuleContext, claimedNames:
|
|
|
523
658
|
return ["## Fields", ...sortedMetaBlocks(entries)];
|
|
524
659
|
};
|
|
525
660
|
|
|
661
|
+
const memberDescription = (member: EnumMember): string => {
|
|
662
|
+
const markers = deprecationMeta(member.annotations).map((note) => `**${upperFirst(note)}.**`);
|
|
663
|
+
|
|
664
|
+
return [...markers, plainText(member.doc)]
|
|
665
|
+
.filter((part) => part.length > 0)
|
|
666
|
+
.join(" ")
|
|
667
|
+
.replaceAll("|", String.raw`\|`);
|
|
668
|
+
};
|
|
669
|
+
|
|
526
670
|
const enumPage = (entry: GiSymbolBase & { kind: "enum"; enumeration: GirEnum }): string => {
|
|
527
671
|
const { enumeration } = entry;
|
|
528
672
|
const kindLabel = enumeration.errorDomain === undefined ? enumeration.kind : "error domain";
|
|
529
673
|
const qualified = qualifiedName(entry);
|
|
530
674
|
|
|
531
|
-
const rows = enumeration.members.map(
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
return `| \`${enumMemberKey(member.name)}\` | \`${member.value}\` | ${description} |`;
|
|
535
|
-
});
|
|
675
|
+
const rows = enumeration.members.map(
|
|
676
|
+
(member) => `| \`${enumMemberKey(member.name)}\` | \`${member.value}\` | ${memberDescription(member)} |`,
|
|
677
|
+
);
|
|
536
678
|
|
|
537
679
|
const usage =
|
|
538
680
|
enumeration.errorDomain === undefined
|
|
@@ -551,7 +693,12 @@ const callbackPage = (entry: GiSymbolBase & { kind: "callback"; callback: GirCal
|
|
|
551
693
|
const parameters = renderMethodSignature(docsContext, fn);
|
|
552
694
|
const signature = `type ${entry.name} = (${parameters}) => ${renderMethodReturnType(docsContext, fn)}`;
|
|
553
695
|
|
|
554
|
-
return joinSections([
|
|
696
|
+
return joinSections([
|
|
697
|
+
...pageHeader(entry, "callback"),
|
|
698
|
+
"## Signature",
|
|
699
|
+
`\`\`\`ts\n${signature}\n\`\`\``,
|
|
700
|
+
...pageTagNotes(callableSpec(docsContext, fn, {})),
|
|
701
|
+
]);
|
|
555
702
|
};
|
|
556
703
|
|
|
557
704
|
const aliasPage = (entry: GiSymbolBase & { kind: "alias"; alias: GirAlias }, library: Library): string => {
|
|
@@ -576,9 +723,12 @@ const functionSignature = (context: ModuleContext, name: string, fn: GirFunction
|
|
|
576
723
|
|
|
577
724
|
const functionPage = (entry: GiSymbolBase & { kind: "function"; fn: GirFunction }, library: Library): string => {
|
|
578
725
|
const docsContext = docsSignatureContext(entry.namespace, library);
|
|
579
|
-
const
|
|
726
|
+
const siblings = entry.namespace.functions;
|
|
727
|
+
const signature = functionSignature(docsContext, entry.name, entry.fn, siblings);
|
|
728
|
+
const finishFn = matchStaticFinishFunction(docsContext, entry.fn, siblings);
|
|
729
|
+
const spec = callableSpec(docsContext, entry.fn, { finishFn });
|
|
580
730
|
|
|
581
|
-
return joinSections([...pageHeader(entry, "function"), `\`\`\`ts\n${signature}\n
|
|
731
|
+
return joinSections([...pageHeader(entry, "function"), `\`\`\`ts\n${signature}\n\`\`\``, ...pageTagNotes(spec)]);
|
|
582
732
|
};
|
|
583
733
|
|
|
584
734
|
const constantPage = (entry: GiSymbolBase & { kind: "constant"; constant: GirConstant }, library: Library): string => {
|