@gtkx/codegen 1.2.0 → 1.2.2
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/dist/docs/symbol-page.js +1 -1
- package/dist/docs/symbol-page.js.map +1 -1
- package/dist/gir/class.d.ts +7 -2
- package/dist/gir/class.d.ts.map +1 -1
- package/dist/gir/class.js +4 -1
- package/dist/gir/class.js.map +1 -1
- package/dist/store/gi/interface.js +2 -2
- package/dist/store/gi/interface.js.map +1 -1
- package/dist/store/gi/record-constructor.d.ts.map +1 -1
- package/dist/store/gi/record-constructor.js +4 -2
- package/dist/store/gi/record-constructor.js.map +1 -1
- package/dist/store/gi/record-field-accessor.d.ts +3 -2
- package/dist/store/gi/record-field-accessor.d.ts.map +1 -1
- package/dist/store/gi/record-field-accessor.js +156 -18
- package/dist/store/gi/record-field-accessor.js.map +1 -1
- package/dist/store/gi/record-layout.d.ts +5 -2
- package/dist/store/gi/record-layout.d.ts.map +1 -1
- package/dist/store/gi/record-layout.js +2 -1
- package/dist/store/gi/record-layout.js.map +1 -1
- package/dist/store/gi/signal.d.ts.map +1 -1
- package/dist/store/gi/signal.js +14 -14
- package/dist/store/gi/signal.js.map +1 -1
- package/dist/store/resolve-store.d.ts.map +1 -1
- package/dist/store/resolve-store.js +1 -0
- package/dist/store/resolve-store.js.map +1 -1
- package/package.json +3 -3
- package/src/docs/symbol-page.ts +1 -1
- package/src/gir/class.ts +12 -3
- package/src/store/gi/interface.ts +2 -2
- package/src/store/gi/record-constructor.ts +4 -2
- package/src/store/gi/record-field-accessor.ts +241 -20
- package/src/store/gi/record-layout.ts +11 -1
- package/src/store/gi/signal.ts +20 -23
- package/src/store/resolve-store.ts +1 -0
package/dist/docs/symbol-page.js
CHANGED
|
@@ -385,7 +385,7 @@ const fieldsSection = (record, context, claimedNames) => {
|
|
|
385
385
|
const { slots } = computeRecordFieldSlots(context, record.fields, record.isUnion);
|
|
386
386
|
const entries = [];
|
|
387
387
|
for (const slot of slots) {
|
|
388
|
-
const field = resolveRecordFieldEntry(context, slot, claimedNames);
|
|
388
|
+
const field = resolveRecordFieldEntry(context, slot, claimedNames, record.fields);
|
|
389
389
|
if (field === undefined) {
|
|
390
390
|
continue;
|
|
391
391
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-page.js","sourceRoot":"","sources":["../../src/docs/symbol-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAShF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAoB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAsD,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACH,eAAe,EACf,aAAa,EACb,yBAAyB,EACzB,6BAA6B,EAC7B,qBAAqB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACH,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAyB,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA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EAA8C,CAAC","sourcesContent":["import { sanitizeTypeIdentifier, sortStringsBy, upperFirst } from \"@gtkx/utils\";\nimport type { GirAnnotations } from \"../gir/annotations.js\";\nimport type { GirClass } from \"../gir/class.js\";\nimport type { EnumMember, GirEnum } from \"../gir/enum.js\";\nimport type { GirFunction } from \"../gir/function.js\";\nimport type { Library } from \"../gir/library.js\";\nimport type { GirRecord } from \"../gir/record.js\";\nimport type { ModuleContext } from \"../writer/context.js\";\nimport type { JsDocSpec } from \"../writer/doc.js\";\nimport { reservedSignalMemberRename } from \"../analysis/inheritance.js\";\nimport { renderTsType } from \"../analysis/ts-type.js\";\nimport { ancestorChain } from \"../gir/ancestry.js\";\nimport { callbackAsFunction, type GirCallback } from \"../gir/callback.js\";\nimport { type GirAlias, type GirConstant, type GirNamespace, namespaceDirectory } from \"../gir/namespace.js\";\nimport { PRIMITIVE_TS_TYPE, primitiveCategory } from \"../gir/primitives.js\";\nimport { callableSpec } from \"../store/gi/callable-doc.js\";\nimport {\n dedupeCallables,\n instanceScope,\n matchStaticFinishFunction,\n renderInstanceMethodSignature,\n renderStaticSignature,\n} from \"../store/gi/callables.js\";\nimport { constantLiteral } from \"../store/gi/constant.js\";\nimport { annotationSpec } from \"../store/gi/doc-spec.js\";\nimport { enumMemberKey } from \"../store/gi/enum.js\";\nimport {\n methodExportName,\n renderMethodReturnType,\n renderMethodSignature,\n renderPromisifiedSignature,\n} from \"../store/gi/method.js\";\nimport { resolveAccessor, type ResolvedAccessor } from \"../store/gi/property-accessor.js\";\nimport { resolveRecordFieldEntry } from \"../store/gi/record-field-accessor.js\";\nimport { computeRecordFieldSlots } from \"../store/gi/record-layout.js\";\nimport { vfuncEntries } from \"../store/gi/vtable.js\";\nimport { implementedInterfaces, newlyImplementedInterfaces } from \"../store/jsx/intrinsic-elements.js\";\nimport {\n annotationNotes,\n classMethodEntries,\n deprecationMeta,\n docMarkdown,\n docsSignatureContext,\n firstSentence,\n implementsLine,\n joinSections,\n type MetaDocEntry,\n methodsSectionBlocks,\n originSignatureBlocks,\n type OriginSignatureEntry,\n plainText,\n propertyMetaLine,\n qualifiedClassName,\n renderDocsSignalHandlerType,\n renderDocsType,\n signalTags,\n signatureBlock,\n type SignatureEntry,\n signatureEntryBlock,\n sortedMetaBlocks,\n tagNotes,\n} from \"./render.js\";\n\n/** What every indexed GIR symbol carries, whatever its kind. */\ntype GiSymbolBase = {\n /** GIR namespace declaring the symbol. */\n namespace: GirNamespace;\n /** Name the bindings export it under: camelCase for functions, PascalCase for classes, the GIR name otherwise. */\n name: string;\n /** Raw gtk-doc text from the GIR, undefined when the symbol is undocumented. */\n doc: string | undefined;\n};\n\n/** A GIR symbol the reference indexes, discriminated by `kind` and carrying the GIR node its page renders from. */\ntype GiSymbolEntry =\n | (GiSymbolBase & {\n /** Renders the class page: hierarchy, constructors, static methods, properties, signals, and methods. */\n kind: \"class\" | \"interface\";\n /** Supplies the ancestry, members, and, on an interface, the vtable slots an implementer fills. */\n klass: GirClass;\n }) |\n (GiSymbolBase & {\n /** Renders the record page, labeled `union` when the record is one. */\n kind: \"record\";\n /** Supplies the constructors, static methods, fields, and instance methods. */\n record: GirRecord;\n }) |\n (GiSymbolBase & {\n /** Renders the page for an enumeration, a flags type, or an error domain, as a table of members. */\n kind: \"enum\";\n /** Supplies the members, their values, and the GError domain when the enum carries one. */\n enumeration: GirEnum;\n }) |\n (GiSymbolBase & {\n /** Renders the callback page as a single function type signature. */\n kind: \"callback\";\n /** Supplies the parameters and return type the signature is rendered from. */\n callback: GirCallback;\n }) |\n (GiSymbolBase & {\n /** Renders the alias page as the type the alias resolves to. */\n kind: \"alias\";\n /** Supplies the target type the page prints. */\n alias: GirAlias;\n }) |\n (GiSymbolBase & {\n /** Renders the page for a namespace-level function, promisified when a finish function matches it. */\n kind: \"function\";\n /** Supplies the parameters and return type the signature is rendered from. */\n fn: GirFunction;\n }) |\n (GiSymbolBase & {\n /** Renders the page for a namespace-level constant, showing its type and literal value. */\n kind: \"constant\";\n /** Supplies the type and the value the literal is emitted from. */\n constant: GirConstant;\n });\n\ntype ClassSymbol = GiSymbolBase & { klass: GirClass };\ntype ClassPageSymbol = ClassSymbol & { kind: \"class\" | \"interface\" };\n\n/** What {@link renderSymbolPage} needs besides the entry itself. */\ntype SymbolPageOptions = {\n /** Parsed GIR the page resolves ancestry, interfaces, and referenced types against. */\n library: Library;\n /** Looks up the JSX element a class is also available as, undefined when it has none. */\n elementNameFor: (namespaceName: string, className: string) => string | undefined;\n};\n\ntype StaticSectionOptions = {\n title: string;\n intro: string;\n context: ModuleContext;\n callables: GirFunction[];\n siblings: GirFunction[];\n returnTypeOverride?: string;\n};\n\ntype MemberOwner = {\n klass: GirClass;\n namespace: GirNamespace;\n origin: string | undefined;\n};\n\ntype PropertyAccessorSetup = {\n context: ModuleContext;\n claimedNames: Set<string>;\n};\n\ntype ResolvedRecordField = NonNullable<ReturnType<typeof resolveRecordFieldEntry>>;\n\nconst qualifiedName = (entry: GiSymbolBase): string => `${entry.namespace.name}.${entry.name}`;\nconst pageTagNotes = (spec: JsDocSpec): string[] => tagNotes({ ...spec, deprecated: undefined, since: undefined });\n\nconst frontmatter = (entry: GiSymbolBase, kindLabel: string): string => {\n const sentence = firstSentence(entry.doc);\n const description = sentence.length > 0 ? sentence : `API reference for the ${qualifiedName(entry)} ${kindLabel}.`;\n\n return `---\\ndescription: ${JSON.stringify(description)}\\n---`;\n};\n\nconst kindLine = (kindLabel: string, namespace: GirNamespace): string =>\n `\\`${kindLabel}\\` in \\`@gtkx/gi/${namespaceDirectory(namespace)}\\``;\n\nconst importBlock = (entry: GiSymbolBase): string =>\n `\\`\\`\\`ts\\nimport * as ${entry.namespace.name} from \"@gtkx/gi/${namespaceDirectory(entry.namespace)}\";\\n\\`\\`\\``;\n\nconst entryAnnotations = (entry: GiSymbolEntry): GirAnnotations => {\n switch (entry.kind) {\n case \"class\":\n case \"interface\": {\n return entry.klass.annotations;\n }\n case \"record\": {\n return entry.record.annotations;\n }\n case \"enum\": {\n return entry.enumeration.annotations;\n }\n case \"callback\": {\n return entry.callback.annotations;\n }\n case \"alias\": {\n return entry.alias.annotations;\n }\n case \"function\": {\n return entry.fn.annotations;\n }\n case \"constant\": {\n return entry.constant.annotations;\n }\n }\n};\n\nconst pageHeader = (entry: GiSymbolEntry, kindLabel: string): string[] => [\n frontmatter(entry, kindLabel),\n `# ${qualifiedName(entry)}`,\n kindLine(kindLabel, entry.namespace),\n docMarkdown(entry.doc),\n ...annotationNotes(entryAnnotations(entry)),\n importBlock(entry),\n];\n\nconst elementNote = (entry: ClassSymbol, options: SymbolPageOptions): string[] => {\n const glibName = options.elementNameFor(entry.namespace.name, entry.klass.name);\n\n if (glibName === undefined) {\n return [];\n }\n\n return [\n `Also available as the \\`${glibName}\\` JSX element from ` +\n `\\`@gtkx/jsx/${namespaceDirectory(entry.namespace)}\\`; the \\`${glibName}\\` element page ` +\n \"documents the JSX props.\",\n ];\n};\n\nconst hierarchySection = (entry: ClassSymbol, library: Library): string[] => {\n const ancestors = [...ancestorChain(library, entry.klass, entry.namespace.name)].slice(1).toReversed();\n\n const interfaces = implementedInterfaces(entry.klass, entry.namespace, library).map((iface) =>\n qualifiedClassName(iface.namespace.name, iface.klass.name),\n );\n\n if (ancestors.length === 0 && interfaces.length === 0) {\n return [];\n }\n\n const lines = [\"## Hierarchy\"];\n\n if (ancestors.length > 0) {\n const parts = ancestors.map(\n (ancestor) => `\\`${qualifiedClassName(ancestor.namespaceName, ancestor.klass.name)}\\``,\n );\n\n parts.push(`**${qualifiedName(entry)}**`);\n lines.push(parts.join(\" → \"));\n }\n\n lines.push(...implementsLine(interfaces));\n\n return lines;\n};\n\nconst prerequisitesLine = (entry: ClassSymbol, library: Library): string[] => {\n const names = entry.klass.prerequisites.map((name) => {\n const resolved = library.resolveType(entry.namespace.name, name);\n\n if (resolved === undefined || (resolved.kind !== \"class\" && resolved.kind !== \"interface\")) {\n return `\\`${name}\\``;\n }\n\n return `\\`${qualifiedClassName(resolved.namespace.name, resolved.value.name)}\\``;\n });\n\n if (names.length === 0) {\n return [];\n }\n\n return [`Requires ${names.join(\", \")}.`];\n};\n\nconst interfaceImplementingIntro = (entry: ClassSymbol): string => {\n const qualified = qualifiedName(entry);\n\n return (\n `A class fills these vtable slots to adopt the interface: declare \\`implements ${qualified}Impl\\` ` +\n `on it and pass \\`${qualified}\\` in the \\`implements\\` option of \\`registerClass\\`. Every slot is ` +\n \"optional, and one the class leaves out keeps whatever the interface installs by default. The \" +\n \"methods, properties, and signals above come from GLib dispatch.\"\n );\n};\n\nconst classImplementingIntro = (entry: ClassSymbol): string => {\n const qualified = qualifiedName(entry);\n\n return (\n \"A subclass declared with `registerClass` overrides these virtual methods to change what \" +\n `\\`${qualified}\\` does: define the slot as a method on the subclass and call \\`super.<slot>(...)\\` ` +\n \"to chain up to the inherited implementation. A slot the subclass leaves out keeps that \" +\n \"implementation unchanged.\"\n );\n};\n\nconst implementingIntro = (entry: ClassPageSymbol): string =>\n entry.kind === \"interface\" ? interfaceImplementingIntro(entry) : classImplementingIntro(entry);\n\nconst implementingSection = (entry: ClassPageSymbol, library: Library): string[] => {\n const context = docsSignatureContext(entry.namespace, library);\n const entries = vfuncEntries(context, entry.namespace.name, entry.klass);\n\n if (entries.length === 0) {\n return [];\n }\n\n const blocks = sortStringsBy(entries, (item) => item.name).map((item) =>\n signatureBlock(item.name, item.signature, [docMarkdown(item.doc)]));\n\n return [\"## Implementing\", implementingIntro(entry), ...blocks];\n};\n\nconst staticEntry = (options: StaticSectionOptions, callable: GirFunction): SignatureEntry | undefined => {\n const signature = renderStaticSignature(options.context, callable, {\n returnTypeOverride: options.returnTypeOverride,\n siblings: options.siblings,\n });\n\n if (signature === undefined) {\n return undefined;\n }\n\n const finishFn = matchStaticFinishFunction(options.context, callable, options.siblings);\n\n return {\n name: signature.name,\n signature: signature.signature,\n doc: docMarkdown(callable.doc),\n tags: callableSpec(options.context, callable, { finishFn }),\n };\n};\n\nconst staticSection = (options: StaticSectionOptions): string[] => {\n const entries: SignatureEntry[] = [];\n\n for (const callable of dedupeCallables(options.callables)) {\n const entry = staticEntry(options, callable);\n\n if (entry !== undefined) {\n entries.push(entry);\n }\n }\n\n if (entries.length === 0) {\n return [];\n }\n\n const blocks = sortStringsBy(entries, (item) => item.name).map((item) => signatureEntryBlock(item));\n\n return [options.title, options.intro, ...blocks];\n};\n\nconst memberOwners = (entry: ClassSymbol, library: Library): MemberOwner[] => [\n { klass: entry.klass, namespace: entry.namespace, origin: undefined },\n ...newlyImplementedInterfaces(entry.klass, entry.namespace, library).map((iface) => ({\n klass: iface.klass,\n namespace: iface.namespace,\n origin: qualifiedClassName(iface.namespace.name, iface.klass.name),\n })),\n];\n\nconst interfaceMethodNames = (library: Library, owner: MemberOwner): string[] => {\n const context = docsSignatureContext(owner.namespace, library);\n const className = sanitizeTypeIdentifier(owner.klass.name);\n const methods = dedupeCallables(owner.klass.methods);\n\n const scope = instanceScope(className, {\n constructors: dedupeCallables(owner.klass.constructors),\n functions: dedupeCallables(owner.klass.functions),\n methods,\n });\n\n const names: string[] = [];\n\n for (const callable of methods) {\n const rename = reservedSignalMemberRename(className, callable);\n const rendered = renderInstanceMethodSignature(context, { ...callable, doc: undefined }, scope, rename);\n\n if (rendered === undefined) {\n continue;\n }\n\n names.push(rename ?? methodExportName(callable));\n }\n\n return names;\n};\n\nconst propertyAccessorSetup = (\n owner: MemberOwner,\n library: Library,\n isUseClassRenames: boolean,\n): PropertyAccessorSetup => {\n const claimedNames = new Set(\n isUseClassRenames\n ? classMethodEntries(library, owner.namespace, owner.klass).map((item) => item.name)\n : interfaceMethodNames(library, owner),\n );\n\n return {\n context: docsSignatureContext(owner.namespace, library),\n claimedNames,\n };\n};\n\nconst getAccessNotes = (accessor: ResolvedAccessor): string[] => {\n if (!accessor.isWritable) {\n return [\"read-only\"];\n }\n\n if (!accessor.hasGetter) {\n return [\"write-only\"];\n }\n\n return accessor.readType === accessor.writeType ? [] : [`writes \\`${accessor.writeType}\\``];\n};\n\nconst documentedAccessorType = (accessor: ResolvedAccessor): string =>\n accessor.hasGetter ? accessor.readType : accessor.writeType;\n\nconst ownerPropertyEntries = (owner: MemberOwner, setup: PropertyAccessorSetup, seen: Set<string>): MetaDocEntry[] => {\n const entries: MetaDocEntry[] = [];\n\n for (const property of owner.klass.properties) {\n const accessor = resolveAccessor({\n context: setup.context,\n property,\n claimedNames: setup.claimedNames,\n });\n\n if (accessor === undefined || seen.has(accessor.jsName)) {\n continue;\n }\n\n seen.add(accessor.jsName);\n\n entries.push({\n name: accessor.jsName,\n meta: propertyMetaLine({\n type: documentedAccessorType(accessor),\n property,\n accessNotes: getAccessNotes(accessor),\n origin: owner.origin,\n }),\n doc: docMarkdown(property.doc),\n tags: annotationSpec(property.annotations),\n });\n }\n\n return entries;\n};\n\nconst propertiesSection = (entry: ClassPageSymbol, library: Library): string[] => {\n const seen: Set<string> = new Set();\n const entries: MetaDocEntry[] = [];\n\n for (const [index, owner] of memberOwners(entry, library).entries()) {\n const isUseClassRenames = index === 0 && entry.kind === \"class\";\n const setup = propertyAccessorSetup(owner, library, isUseClassRenames);\n entries.push(...ownerPropertyEntries(owner, setup, seen));\n }\n\n if (entries.length === 0) {\n return [];\n }\n\n const intro =\n \"Properties are read and written as instance fields; changes can be observed with \" +\n \"`connect(\\\"notify::<property-name>\\\", handler)`. Properties inherited from ancestors are \" +\n \"documented on their own pages.\";\n\n return [\"## Properties\", intro, ...sortedMetaBlocks(entries)];\n};\n\nconst ownerSignalEntries = (owner: MemberOwner, library: Library, seen: Set<string>): OriginSignatureEntry[] => {\n const entries: OriginSignatureEntry[] = [];\n\n for (const signal of owner.klass.signals) {\n if (seen.has(signal.name)) {\n continue;\n }\n\n seen.add(signal.name);\n\n entries.push({\n name: signal.name,\n signature: renderDocsSignalHandlerType(library, signal),\n doc: docMarkdown(signal.doc),\n tags: signalTags(signal, false),\n origin: owner.origin,\n });\n }\n\n return entries;\n};\n\nconst signalsSection = (entry: ClassSymbol, library: Library): string[] => {\n const seen: Set<string> = new Set();\n const entries: OriginSignatureEntry[] = [];\n\n for (const owner of memberOwners(entry, library)) {\n entries.push(...ownerSignalEntries(owner, library, seen));\n }\n\n if (entries.length === 0) {\n return [];\n }\n\n const intro =\n \"Connect with `instance.connect(\\\"<signal>\\\", handler)` or `instance.on(\\\"<signal>\\\", handler)`. \" +\n \"Signals inherited from ancestors are documented on their own pages.\";\n\n return [\"## Signals\", intro, ...originSignatureBlocks(entries)];\n};\n\nconst classMethodsSection = (entry: ClassSymbol, library: Library): string[] =>\n methodsSectionBlocks(\n classMethodEntries(library, entry.namespace, entry.klass),\n \"Methods are called on instances. Methods inherited from ancestors are documented on their own pages.\",\n );\n\nconst classPage = (entry: ClassPageSymbol, options: SymbolPageOptions): string => {\n const { library } = options;\n const qualified = qualifiedName(entry);\n const docsContext = docsSignatureContext(entry.namespace, library);\n const constructorsIntro = `Constructors are called on the class: \\`${qualified}.new(...)\\`.`;\n const staticIntro = `Static methods are called on the class: \\`${qualified}.<method>(...)\\`.`;\n const staticSiblings = [...entry.klass.constructors, ...entry.klass.functions];\n\n return joinSections([\n ...pageHeader(entry, entry.kind),\n ...elementNote(entry, options),\n ...(entry.kind === \"interface\" ? prerequisitesLine(entry, library) : hierarchySection(entry, library)),\n ...staticSection({\n title: \"## Constructors\",\n intro: constructorsIntro,\n context: docsContext,\n callables: entry.klass.constructors,\n siblings: staticSiblings,\n returnTypeOverride: qualified,\n }),\n ...staticSection({\n title: \"## Static methods\",\n intro: staticIntro,\n context: docsContext,\n callables: entry.klass.functions,\n siblings: staticSiblings,\n }),\n ...propertiesSection(entry, library),\n ...signalsSection(entry, library),\n ...classMethodsSection(entry, library),\n ...implementingSection(entry, library),\n ]);\n};\n\nconst renderSymbolPage = (entry: GiSymbolEntry, options: SymbolPageOptions): string => {\n switch (entry.kind) {\n case \"class\":\n case \"interface\": {\n return classPage(entry, options);\n }\n case \"record\": {\n return recordPage(entry, options.library);\n }\n case \"enum\": {\n return enumPage(entry);\n }\n case \"callback\": {\n return callbackPage(entry, options.library);\n }\n case \"alias\": {\n return aliasPage(entry, options.library);\n }\n case \"function\": {\n return functionPage(entry, options.library);\n }\n case \"constant\": {\n return constantPage(entry, options.library);\n }\n }\n};\n\nconst recordInstanceEntries = (context: ModuleContext, record: GirRecord): SignatureEntry[] => {\n const entries: SignatureEntry[] = [];\n\n for (const callable of dedupeCallables(record.methods)) {\n const rendered = renderStaticSignature(context, callable);\n\n if (rendered === undefined) {\n continue;\n }\n\n entries.push({\n name: rendered.name,\n signature: rendered.signature,\n doc: docMarkdown(callable.doc),\n tags: callableSpec(context, callable, {}),\n });\n }\n\n return sortStringsBy(entries, (item) => item.name);\n};\n\nconst recordPage = (entry: GiSymbolBase & { kind: \"record\"; record: GirRecord }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const qualified = qualifiedName(entry);\n const constructorsIntro = `Constructors are called on the class: \\`${qualified}.new(...)\\`.`;\n const staticIntro = `Static methods are called on the class: \\`${qualified}.<method>(...)\\`.`;\n const methodEntries = recordInstanceEntries(docsContext, entry.record);\n const claimedNames = new Set(methodEntries.map((item) => item.name));\n const staticSiblings = [...entry.record.constructors, ...entry.record.functions];\n\n return joinSections([\n ...pageHeader(entry, entry.record.isUnion ? \"union\" : \"record\"),\n ...staticSection({\n title: \"## Constructors\",\n intro: constructorsIntro,\n context: docsContext,\n callables: entry.record.constructors,\n siblings: staticSiblings,\n returnTypeOverride: qualified,\n }),\n ...staticSection({\n title: \"## Static methods\",\n intro: staticIntro,\n context: docsContext,\n callables: entry.record.functions,\n siblings: staticSiblings,\n }),\n ...fieldsSection(entry.record, docsContext, claimedNames),\n ...methodsSectionBlocks(methodEntries, \"Methods are called on instances.\"),\n ]);\n};\n\nconst fieldMeta = (field: ResolvedRecordField): string =>\n [\n `\\`${field.tsType}\\``,\n ...(field.isWritable ? [] : [\"read-only\"]),\n ...deprecationMeta(field.annotations),\n ].join(\" · \");\n\nconst fieldsSection = (record: GirRecord, context: ModuleContext, claimedNames: Set<string>): string[] => {\n const { slots } = computeRecordFieldSlots(context, record.fields, record.isUnion);\n const entries: MetaDocEntry[] = [];\n\n for (const slot of slots) {\n const field = resolveRecordFieldEntry(context, slot, claimedNames);\n\n if (field === undefined) {\n continue;\n }\n\n entries.push({\n name: field.jsName,\n meta: fieldMeta(field),\n doc: docMarkdown(field.doc),\n tags: annotationSpec(field.annotations),\n });\n }\n\n if (entries.length === 0) {\n return [];\n }\n\n return [\"## Fields\", ...sortedMetaBlocks(entries)];\n};\n\nconst memberDescription = (member: EnumMember): string => {\n const markers = deprecationMeta(member.annotations).map((note) => `**${upperFirst(note)}.**`);\n\n return [...markers, plainText(member.doc)]\n .filter((part) => part.length > 0)\n .join(\" \")\n .replaceAll(\"|\", String.raw`\\|`);\n};\n\nconst enumPage = (entry: GiSymbolBase & { kind: \"enum\"; enumeration: GirEnum }): string => {\n const { enumeration } = entry;\n const kindLabel = enumeration.errorDomain === undefined ? enumeration.kind : \"error domain\";\n const qualified = qualifiedName(entry);\n\n const rows = enumeration.members.map(\n (member) => `| \\`${enumMemberKey(member.name)}\\` | \\`${member.value}\\` | ${memberDescription(member)} |`,\n );\n\n const usage =\n enumeration.errorDomain === undefined\n ? `Members are accessed as \\`${qualified}.<member>\\`.`\n : `Members are error codes for the \\`${enumeration.errorDomain}\\` GError domain, ` +\n `accessed as \\`${qualified}.<member>\\`.`;\n\n const table = [\"| Member | Value | Description |\", \"| --- | --- | --- |\", ...rows].join(\"\\n\");\n\n return joinSections([...pageHeader(entry, kindLabel), \"## Members\", usage, table]);\n};\n\nconst callbackPage = (entry: GiSymbolBase & { kind: \"callback\"; callback: GirCallback }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const fn = callbackAsFunction(entry.callback);\n const parameters = renderMethodSignature(docsContext, fn);\n const signature = `type ${entry.name} = (${parameters}) => ${renderMethodReturnType(docsContext, fn)}`;\n\n return joinSections([\n ...pageHeader(entry, \"callback\"),\n \"## Signature\",\n `\\`\\`\\`ts\\n${signature}\\n\\`\\`\\``,\n ...pageTagNotes(callableSpec(docsContext, fn, {})),\n ]);\n};\n\nconst aliasPage = (entry: GiSymbolBase & { kind: \"alias\"; alias: GirAlias }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const category = entry.alias.cType === undefined ? undefined : primitiveCategory(entry.alias.cType);\n const target = category === \"gtype\" ? PRIMITIVE_TS_TYPE.gtype : renderTsType(docsContext, entry.alias.target);\n\n return joinSections([...pageHeader(entry, \"alias\"), `\\`\\`\\`ts\\ntype ${entry.name} = ${target}\\n\\`\\`\\``]);\n};\n\nconst functionSignature = (context: ModuleContext, name: string, fn: GirFunction, siblings: GirFunction[]): string => {\n const finishFn = matchStaticFinishFunction(context, fn, siblings);\n\n if (finishFn !== undefined) {\n const { signature, returnType } = renderPromisifiedSignature(context, fn, finishFn);\n\n return `function ${name}(${signature}): ${returnType}`;\n }\n\n return `function ${name}(${renderMethodSignature(context, fn)}): ${renderMethodReturnType(context, fn)}`;\n};\n\nconst functionPage = (entry: GiSymbolBase & { kind: \"function\"; fn: GirFunction }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const siblings = entry.namespace.functions;\n const signature = functionSignature(docsContext, entry.name, entry.fn, siblings);\n const finishFn = matchStaticFinishFunction(docsContext, entry.fn, siblings);\n const spec = callableSpec(docsContext, entry.fn, { finishFn });\n\n return joinSections([...pageHeader(entry, \"function\"), `\\`\\`\\`ts\\n${signature}\\n\\`\\`\\``, ...pageTagNotes(spec)]);\n};\n\nconst constantPage = (entry: GiSymbolBase & { kind: \"constant\"; constant: GirConstant }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const type = renderDocsType(library, entry.constant.type, false);\n\n return joinSections([\n ...pageHeader(entry, \"constant\"),\n `\\`\\`\\`ts\\nconst ${entry.name}: ${type} = ${constantLiteral(docsContext, entry.constant)}\\n\\`\\`\\``,\n ]);\n};\n\nexport { renderSymbolPage, type GiSymbolEntry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AAoB,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC;IAC3C,MAAM,SAAS,GAAG,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IACjF,MAAM,QAAQ,GAAG,yBAAyB,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC5E,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE/D,OAAO,YAAY,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,aAAa,SAAS,UAAU,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACrH,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAiE,EAAE,OAAgB,EAAU,EAAE;IACjH,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAEjE,OAAO,YAAY,CAAC;QAChB,GAAG,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC;QAChC,mBAAmB,KAAK,CAAC,IAAI,KAAK,IAAI,MAAM,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,UAAU;KACrG,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAA8C,CAAC","sourcesContent":["import { sanitizeTypeIdentifier, sortStringsBy, upperFirst } from \"@gtkx/utils\";\nimport type { GirAnnotations } from \"../gir/annotations.js\";\nimport type { GirClass } from \"../gir/class.js\";\nimport type { EnumMember, GirEnum } from \"../gir/enum.js\";\nimport type { GirFunction } from \"../gir/function.js\";\nimport type { Library } from \"../gir/library.js\";\nimport type { GirRecord } from \"../gir/record.js\";\nimport type { ModuleContext } from \"../writer/context.js\";\nimport type { JsDocSpec } from \"../writer/doc.js\";\nimport { reservedSignalMemberRename } from \"../analysis/inheritance.js\";\nimport { renderTsType } from \"../analysis/ts-type.js\";\nimport { ancestorChain } from \"../gir/ancestry.js\";\nimport { callbackAsFunction, type GirCallback } from \"../gir/callback.js\";\nimport { type GirAlias, type GirConstant, type GirNamespace, namespaceDirectory } from \"../gir/namespace.js\";\nimport { PRIMITIVE_TS_TYPE, primitiveCategory } from \"../gir/primitives.js\";\nimport { callableSpec } from \"../store/gi/callable-doc.js\";\nimport {\n dedupeCallables,\n instanceScope,\n matchStaticFinishFunction,\n renderInstanceMethodSignature,\n renderStaticSignature,\n} from \"../store/gi/callables.js\";\nimport { constantLiteral } from \"../store/gi/constant.js\";\nimport { annotationSpec } from \"../store/gi/doc-spec.js\";\nimport { enumMemberKey } from \"../store/gi/enum.js\";\nimport {\n methodExportName,\n renderMethodReturnType,\n renderMethodSignature,\n renderPromisifiedSignature,\n} from \"../store/gi/method.js\";\nimport { resolveAccessor, type ResolvedAccessor } from \"../store/gi/property-accessor.js\";\nimport { resolveRecordFieldEntry } from \"../store/gi/record-field-accessor.js\";\nimport { computeRecordFieldSlots } from \"../store/gi/record-layout.js\";\nimport { vfuncEntries } from \"../store/gi/vtable.js\";\nimport { implementedInterfaces, newlyImplementedInterfaces } from \"../store/jsx/intrinsic-elements.js\";\nimport {\n annotationNotes,\n classMethodEntries,\n deprecationMeta,\n docMarkdown,\n docsSignatureContext,\n firstSentence,\n implementsLine,\n joinSections,\n type MetaDocEntry,\n methodsSectionBlocks,\n originSignatureBlocks,\n type OriginSignatureEntry,\n plainText,\n propertyMetaLine,\n qualifiedClassName,\n renderDocsSignalHandlerType,\n renderDocsType,\n signalTags,\n signatureBlock,\n type SignatureEntry,\n signatureEntryBlock,\n sortedMetaBlocks,\n tagNotes,\n} from \"./render.js\";\n\n/** What every indexed GIR symbol carries, whatever its kind. */\ntype GiSymbolBase = {\n /** GIR namespace declaring the symbol. */\n namespace: GirNamespace;\n /** Name the bindings export it under: camelCase for functions, PascalCase for classes, the GIR name otherwise. */\n name: string;\n /** Raw gtk-doc text from the GIR, undefined when the symbol is undocumented. */\n doc: string | undefined;\n};\n\n/** A GIR symbol the reference indexes, discriminated by `kind` and carrying the GIR node its page renders from. */\ntype GiSymbolEntry =\n | (GiSymbolBase & {\n /** Renders the class page: hierarchy, constructors, static methods, properties, signals, and methods. */\n kind: \"class\" | \"interface\";\n /** Supplies the ancestry, members, and, on an interface, the vtable slots an implementer fills. */\n klass: GirClass;\n }) |\n (GiSymbolBase & {\n /** Renders the record page, labeled `union` when the record is one. */\n kind: \"record\";\n /** Supplies the constructors, static methods, fields, and instance methods. */\n record: GirRecord;\n }) |\n (GiSymbolBase & {\n /** Renders the page for an enumeration, a flags type, or an error domain, as a table of members. */\n kind: \"enum\";\n /** Supplies the members, their values, and the GError domain when the enum carries one. */\n enumeration: GirEnum;\n }) |\n (GiSymbolBase & {\n /** Renders the callback page as a single function type signature. */\n kind: \"callback\";\n /** Supplies the parameters and return type the signature is rendered from. */\n callback: GirCallback;\n }) |\n (GiSymbolBase & {\n /** Renders the alias page as the type the alias resolves to. */\n kind: \"alias\";\n /** Supplies the target type the page prints. */\n alias: GirAlias;\n }) |\n (GiSymbolBase & {\n /** Renders the page for a namespace-level function, promisified when a finish function matches it. */\n kind: \"function\";\n /** Supplies the parameters and return type the signature is rendered from. */\n fn: GirFunction;\n }) |\n (GiSymbolBase & {\n /** Renders the page for a namespace-level constant, showing its type and literal value. */\n kind: \"constant\";\n /** Supplies the type and the value the literal is emitted from. */\n constant: GirConstant;\n });\n\ntype ClassSymbol = GiSymbolBase & { klass: GirClass };\ntype ClassPageSymbol = ClassSymbol & { kind: \"class\" | \"interface\" };\n\n/** What {@link renderSymbolPage} needs besides the entry itself. */\ntype SymbolPageOptions = {\n /** Parsed GIR the page resolves ancestry, interfaces, and referenced types against. */\n library: Library;\n /** Looks up the JSX element a class is also available as, undefined when it has none. */\n elementNameFor: (namespaceName: string, className: string) => string | undefined;\n};\n\ntype StaticSectionOptions = {\n title: string;\n intro: string;\n context: ModuleContext;\n callables: GirFunction[];\n siblings: GirFunction[];\n returnTypeOverride?: string;\n};\n\ntype MemberOwner = {\n klass: GirClass;\n namespace: GirNamespace;\n origin: string | undefined;\n};\n\ntype PropertyAccessorSetup = {\n context: ModuleContext;\n claimedNames: Set<string>;\n};\n\ntype ResolvedRecordField = NonNullable<ReturnType<typeof resolveRecordFieldEntry>>;\n\nconst qualifiedName = (entry: GiSymbolBase): string => `${entry.namespace.name}.${entry.name}`;\nconst pageTagNotes = (spec: JsDocSpec): string[] => tagNotes({ ...spec, deprecated: undefined, since: undefined });\n\nconst frontmatter = (entry: GiSymbolBase, kindLabel: string): string => {\n const sentence = firstSentence(entry.doc);\n const description = sentence.length > 0 ? sentence : `API reference for the ${qualifiedName(entry)} ${kindLabel}.`;\n\n return `---\\ndescription: ${JSON.stringify(description)}\\n---`;\n};\n\nconst kindLine = (kindLabel: string, namespace: GirNamespace): string =>\n `\\`${kindLabel}\\` in \\`@gtkx/gi/${namespaceDirectory(namespace)}\\``;\n\nconst importBlock = (entry: GiSymbolBase): string =>\n `\\`\\`\\`ts\\nimport * as ${entry.namespace.name} from \"@gtkx/gi/${namespaceDirectory(entry.namespace)}\";\\n\\`\\`\\``;\n\nconst entryAnnotations = (entry: GiSymbolEntry): GirAnnotations => {\n switch (entry.kind) {\n case \"class\":\n case \"interface\": {\n return entry.klass.annotations;\n }\n case \"record\": {\n return entry.record.annotations;\n }\n case \"enum\": {\n return entry.enumeration.annotations;\n }\n case \"callback\": {\n return entry.callback.annotations;\n }\n case \"alias\": {\n return entry.alias.annotations;\n }\n case \"function\": {\n return entry.fn.annotations;\n }\n case \"constant\": {\n return entry.constant.annotations;\n }\n }\n};\n\nconst pageHeader = (entry: GiSymbolEntry, kindLabel: string): string[] => [\n frontmatter(entry, kindLabel),\n `# ${qualifiedName(entry)}`,\n kindLine(kindLabel, entry.namespace),\n docMarkdown(entry.doc),\n ...annotationNotes(entryAnnotations(entry)),\n importBlock(entry),\n];\n\nconst elementNote = (entry: ClassSymbol, options: SymbolPageOptions): string[] => {\n const glibName = options.elementNameFor(entry.namespace.name, entry.klass.name);\n\n if (glibName === undefined) {\n return [];\n }\n\n return [\n `Also available as the \\`${glibName}\\` JSX element from ` +\n `\\`@gtkx/jsx/${namespaceDirectory(entry.namespace)}\\`; the \\`${glibName}\\` element page ` +\n \"documents the JSX props.\",\n ];\n};\n\nconst hierarchySection = (entry: ClassSymbol, library: Library): string[] => {\n const ancestors = [...ancestorChain(library, entry.klass, entry.namespace.name)].slice(1).toReversed();\n\n const interfaces = implementedInterfaces(entry.klass, entry.namespace, library).map((iface) =>\n qualifiedClassName(iface.namespace.name, iface.klass.name),\n );\n\n if (ancestors.length === 0 && interfaces.length === 0) {\n return [];\n }\n\n const lines = [\"## Hierarchy\"];\n\n if (ancestors.length > 0) {\n const parts = ancestors.map(\n (ancestor) => `\\`${qualifiedClassName(ancestor.namespaceName, ancestor.klass.name)}\\``,\n );\n\n parts.push(`**${qualifiedName(entry)}**`);\n lines.push(parts.join(\" → \"));\n }\n\n lines.push(...implementsLine(interfaces));\n\n return lines;\n};\n\nconst prerequisitesLine = (entry: ClassSymbol, library: Library): string[] => {\n const names = entry.klass.prerequisites.map((name) => {\n const resolved = library.resolveType(entry.namespace.name, name);\n\n if (resolved === undefined || (resolved.kind !== \"class\" && resolved.kind !== \"interface\")) {\n return `\\`${name}\\``;\n }\n\n return `\\`${qualifiedClassName(resolved.namespace.name, resolved.value.name)}\\``;\n });\n\n if (names.length === 0) {\n return [];\n }\n\n return [`Requires ${names.join(\", \")}.`];\n};\n\nconst interfaceImplementingIntro = (entry: ClassSymbol): string => {\n const qualified = qualifiedName(entry);\n\n return (\n `A class fills these vtable slots to adopt the interface: declare \\`implements ${qualified}Impl\\` ` +\n `on it and pass \\`${qualified}\\` in the \\`implements\\` option of \\`registerClass\\`. Every slot is ` +\n \"optional, and one the class leaves out keeps whatever the interface installs by default. The \" +\n \"methods, properties, and signals above come from GLib dispatch.\"\n );\n};\n\nconst classImplementingIntro = (entry: ClassSymbol): string => {\n const qualified = qualifiedName(entry);\n\n return (\n \"A subclass declared with `registerClass` overrides these virtual methods to change what \" +\n `\\`${qualified}\\` does: define the slot as a method on the subclass and call \\`super.<slot>(...)\\` ` +\n \"to chain up to the inherited implementation. A slot the subclass leaves out keeps that \" +\n \"implementation unchanged.\"\n );\n};\n\nconst implementingIntro = (entry: ClassPageSymbol): string =>\n entry.kind === \"interface\" ? interfaceImplementingIntro(entry) : classImplementingIntro(entry);\n\nconst implementingSection = (entry: ClassPageSymbol, library: Library): string[] => {\n const context = docsSignatureContext(entry.namespace, library);\n const entries = vfuncEntries(context, entry.namespace.name, entry.klass);\n\n if (entries.length === 0) {\n return [];\n }\n\n const blocks = sortStringsBy(entries, (item) => item.name).map((item) =>\n signatureBlock(item.name, item.signature, [docMarkdown(item.doc)]));\n\n return [\"## Implementing\", implementingIntro(entry), ...blocks];\n};\n\nconst staticEntry = (options: StaticSectionOptions, callable: GirFunction): SignatureEntry | undefined => {\n const signature = renderStaticSignature(options.context, callable, {\n returnTypeOverride: options.returnTypeOverride,\n siblings: options.siblings,\n });\n\n if (signature === undefined) {\n return undefined;\n }\n\n const finishFn = matchStaticFinishFunction(options.context, callable, options.siblings);\n\n return {\n name: signature.name,\n signature: signature.signature,\n doc: docMarkdown(callable.doc),\n tags: callableSpec(options.context, callable, { finishFn }),\n };\n};\n\nconst staticSection = (options: StaticSectionOptions): string[] => {\n const entries: SignatureEntry[] = [];\n\n for (const callable of dedupeCallables(options.callables)) {\n const entry = staticEntry(options, callable);\n\n if (entry !== undefined) {\n entries.push(entry);\n }\n }\n\n if (entries.length === 0) {\n return [];\n }\n\n const blocks = sortStringsBy(entries, (item) => item.name).map((item) => signatureEntryBlock(item));\n\n return [options.title, options.intro, ...blocks];\n};\n\nconst memberOwners = (entry: ClassSymbol, library: Library): MemberOwner[] => [\n { klass: entry.klass, namespace: entry.namespace, origin: undefined },\n ...newlyImplementedInterfaces(entry.klass, entry.namespace, library).map((iface) => ({\n klass: iface.klass,\n namespace: iface.namespace,\n origin: qualifiedClassName(iface.namespace.name, iface.klass.name),\n })),\n];\n\nconst interfaceMethodNames = (library: Library, owner: MemberOwner): string[] => {\n const context = docsSignatureContext(owner.namespace, library);\n const className = sanitizeTypeIdentifier(owner.klass.name);\n const methods = dedupeCallables(owner.klass.methods);\n\n const scope = instanceScope(className, {\n constructors: dedupeCallables(owner.klass.constructors),\n functions: dedupeCallables(owner.klass.functions),\n methods,\n });\n\n const names: string[] = [];\n\n for (const callable of methods) {\n const rename = reservedSignalMemberRename(className, callable);\n const rendered = renderInstanceMethodSignature(context, { ...callable, doc: undefined }, scope, rename);\n\n if (rendered === undefined) {\n continue;\n }\n\n names.push(rename ?? methodExportName(callable));\n }\n\n return names;\n};\n\nconst propertyAccessorSetup = (\n owner: MemberOwner,\n library: Library,\n isUseClassRenames: boolean,\n): PropertyAccessorSetup => {\n const claimedNames = new Set(\n isUseClassRenames\n ? classMethodEntries(library, owner.namespace, owner.klass).map((item) => item.name)\n : interfaceMethodNames(library, owner),\n );\n\n return {\n context: docsSignatureContext(owner.namespace, library),\n claimedNames,\n };\n};\n\nconst getAccessNotes = (accessor: ResolvedAccessor): string[] => {\n if (!accessor.isWritable) {\n return [\"read-only\"];\n }\n\n if (!accessor.hasGetter) {\n return [\"write-only\"];\n }\n\n return accessor.readType === accessor.writeType ? [] : [`writes \\`${accessor.writeType}\\``];\n};\n\nconst documentedAccessorType = (accessor: ResolvedAccessor): string =>\n accessor.hasGetter ? accessor.readType : accessor.writeType;\n\nconst ownerPropertyEntries = (owner: MemberOwner, setup: PropertyAccessorSetup, seen: Set<string>): MetaDocEntry[] => {\n const entries: MetaDocEntry[] = [];\n\n for (const property of owner.klass.properties) {\n const accessor = resolveAccessor({\n context: setup.context,\n property,\n claimedNames: setup.claimedNames,\n });\n\n if (accessor === undefined || seen.has(accessor.jsName)) {\n continue;\n }\n\n seen.add(accessor.jsName);\n\n entries.push({\n name: accessor.jsName,\n meta: propertyMetaLine({\n type: documentedAccessorType(accessor),\n property,\n accessNotes: getAccessNotes(accessor),\n origin: owner.origin,\n }),\n doc: docMarkdown(property.doc),\n tags: annotationSpec(property.annotations),\n });\n }\n\n return entries;\n};\n\nconst propertiesSection = (entry: ClassPageSymbol, library: Library): string[] => {\n const seen: Set<string> = new Set();\n const entries: MetaDocEntry[] = [];\n\n for (const [index, owner] of memberOwners(entry, library).entries()) {\n const isUseClassRenames = index === 0 && entry.kind === \"class\";\n const setup = propertyAccessorSetup(owner, library, isUseClassRenames);\n entries.push(...ownerPropertyEntries(owner, setup, seen));\n }\n\n if (entries.length === 0) {\n return [];\n }\n\n const intro =\n \"Properties are read and written as instance fields; changes can be observed with \" +\n \"`connect(\\\"notify::<property-name>\\\", handler)`. Properties inherited from ancestors are \" +\n \"documented on their own pages.\";\n\n return [\"## Properties\", intro, ...sortedMetaBlocks(entries)];\n};\n\nconst ownerSignalEntries = (owner: MemberOwner, library: Library, seen: Set<string>): OriginSignatureEntry[] => {\n const entries: OriginSignatureEntry[] = [];\n\n for (const signal of owner.klass.signals) {\n if (seen.has(signal.name)) {\n continue;\n }\n\n seen.add(signal.name);\n\n entries.push({\n name: signal.name,\n signature: renderDocsSignalHandlerType(library, signal),\n doc: docMarkdown(signal.doc),\n tags: signalTags(signal, false),\n origin: owner.origin,\n });\n }\n\n return entries;\n};\n\nconst signalsSection = (entry: ClassSymbol, library: Library): string[] => {\n const seen: Set<string> = new Set();\n const entries: OriginSignatureEntry[] = [];\n\n for (const owner of memberOwners(entry, library)) {\n entries.push(...ownerSignalEntries(owner, library, seen));\n }\n\n if (entries.length === 0) {\n return [];\n }\n\n const intro =\n \"Connect with `instance.connect(\\\"<signal>\\\", handler)` or `instance.on(\\\"<signal>\\\", handler)`. \" +\n \"Signals inherited from ancestors are documented on their own pages.\";\n\n return [\"## Signals\", intro, ...originSignatureBlocks(entries)];\n};\n\nconst classMethodsSection = (entry: ClassSymbol, library: Library): string[] =>\n methodsSectionBlocks(\n classMethodEntries(library, entry.namespace, entry.klass),\n \"Methods are called on instances. Methods inherited from ancestors are documented on their own pages.\",\n );\n\nconst classPage = (entry: ClassPageSymbol, options: SymbolPageOptions): string => {\n const { library } = options;\n const qualified = qualifiedName(entry);\n const docsContext = docsSignatureContext(entry.namespace, library);\n const constructorsIntro = `Constructors are called on the class: \\`${qualified}.new(...)\\`.`;\n const staticIntro = `Static methods are called on the class: \\`${qualified}.<method>(...)\\`.`;\n const staticSiblings = [...entry.klass.constructors, ...entry.klass.functions];\n\n return joinSections([\n ...pageHeader(entry, entry.kind),\n ...elementNote(entry, options),\n ...(entry.kind === \"interface\" ? prerequisitesLine(entry, library) : hierarchySection(entry, library)),\n ...staticSection({\n title: \"## Constructors\",\n intro: constructorsIntro,\n context: docsContext,\n callables: entry.klass.constructors,\n siblings: staticSiblings,\n returnTypeOverride: qualified,\n }),\n ...staticSection({\n title: \"## Static methods\",\n intro: staticIntro,\n context: docsContext,\n callables: entry.klass.functions,\n siblings: staticSiblings,\n }),\n ...propertiesSection(entry, library),\n ...signalsSection(entry, library),\n ...classMethodsSection(entry, library),\n ...implementingSection(entry, library),\n ]);\n};\n\nconst renderSymbolPage = (entry: GiSymbolEntry, options: SymbolPageOptions): string => {\n switch (entry.kind) {\n case \"class\":\n case \"interface\": {\n return classPage(entry, options);\n }\n case \"record\": {\n return recordPage(entry, options.library);\n }\n case \"enum\": {\n return enumPage(entry);\n }\n case \"callback\": {\n return callbackPage(entry, options.library);\n }\n case \"alias\": {\n return aliasPage(entry, options.library);\n }\n case \"function\": {\n return functionPage(entry, options.library);\n }\n case \"constant\": {\n return constantPage(entry, options.library);\n }\n }\n};\n\nconst recordInstanceEntries = (context: ModuleContext, record: GirRecord): SignatureEntry[] => {\n const entries: SignatureEntry[] = [];\n\n for (const callable of dedupeCallables(record.methods)) {\n const rendered = renderStaticSignature(context, callable);\n\n if (rendered === undefined) {\n continue;\n }\n\n entries.push({\n name: rendered.name,\n signature: rendered.signature,\n doc: docMarkdown(callable.doc),\n tags: callableSpec(context, callable, {}),\n });\n }\n\n return sortStringsBy(entries, (item) => item.name);\n};\n\nconst recordPage = (entry: GiSymbolBase & { kind: \"record\"; record: GirRecord }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const qualified = qualifiedName(entry);\n const constructorsIntro = `Constructors are called on the class: \\`${qualified}.new(...)\\`.`;\n const staticIntro = `Static methods are called on the class: \\`${qualified}.<method>(...)\\`.`;\n const methodEntries = recordInstanceEntries(docsContext, entry.record);\n const claimedNames = new Set(methodEntries.map((item) => item.name));\n const staticSiblings = [...entry.record.constructors, ...entry.record.functions];\n\n return joinSections([\n ...pageHeader(entry, entry.record.isUnion ? \"union\" : \"record\"),\n ...staticSection({\n title: \"## Constructors\",\n intro: constructorsIntro,\n context: docsContext,\n callables: entry.record.constructors,\n siblings: staticSiblings,\n returnTypeOverride: qualified,\n }),\n ...staticSection({\n title: \"## Static methods\",\n intro: staticIntro,\n context: docsContext,\n callables: entry.record.functions,\n siblings: staticSiblings,\n }),\n ...fieldsSection(entry.record, docsContext, claimedNames),\n ...methodsSectionBlocks(methodEntries, \"Methods are called on instances.\"),\n ]);\n};\n\nconst fieldMeta = (field: ResolvedRecordField): string =>\n [\n `\\`${field.tsType}\\``,\n ...(field.isWritable ? [] : [\"read-only\"]),\n ...deprecationMeta(field.annotations),\n ].join(\" · \");\n\nconst fieldsSection = (record: GirRecord, context: ModuleContext, claimedNames: Set<string>): string[] => {\n const { slots } = computeRecordFieldSlots(context, record.fields, record.isUnion);\n const entries: MetaDocEntry[] = [];\n\n for (const slot of slots) {\n const field = resolveRecordFieldEntry(context, slot, claimedNames, record.fields);\n\n if (field === undefined) {\n continue;\n }\n\n entries.push({\n name: field.jsName,\n meta: fieldMeta(field),\n doc: docMarkdown(field.doc),\n tags: annotationSpec(field.annotations),\n });\n }\n\n if (entries.length === 0) {\n return [];\n }\n\n return [\"## Fields\", ...sortedMetaBlocks(entries)];\n};\n\nconst memberDescription = (member: EnumMember): string => {\n const markers = deprecationMeta(member.annotations).map((note) => `**${upperFirst(note)}.**`);\n\n return [...markers, plainText(member.doc)]\n .filter((part) => part.length > 0)\n .join(\" \")\n .replaceAll(\"|\", String.raw`\\|`);\n};\n\nconst enumPage = (entry: GiSymbolBase & { kind: \"enum\"; enumeration: GirEnum }): string => {\n const { enumeration } = entry;\n const kindLabel = enumeration.errorDomain === undefined ? enumeration.kind : \"error domain\";\n const qualified = qualifiedName(entry);\n\n const rows = enumeration.members.map(\n (member) => `| \\`${enumMemberKey(member.name)}\\` | \\`${member.value}\\` | ${memberDescription(member)} |`,\n );\n\n const usage =\n enumeration.errorDomain === undefined\n ? `Members are accessed as \\`${qualified}.<member>\\`.`\n : `Members are error codes for the \\`${enumeration.errorDomain}\\` GError domain, ` +\n `accessed as \\`${qualified}.<member>\\`.`;\n\n const table = [\"| Member | Value | Description |\", \"| --- | --- | --- |\", ...rows].join(\"\\n\");\n\n return joinSections([...pageHeader(entry, kindLabel), \"## Members\", usage, table]);\n};\n\nconst callbackPage = (entry: GiSymbolBase & { kind: \"callback\"; callback: GirCallback }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const fn = callbackAsFunction(entry.callback);\n const parameters = renderMethodSignature(docsContext, fn);\n const signature = `type ${entry.name} = (${parameters}) => ${renderMethodReturnType(docsContext, fn)}`;\n\n return joinSections([\n ...pageHeader(entry, \"callback\"),\n \"## Signature\",\n `\\`\\`\\`ts\\n${signature}\\n\\`\\`\\``,\n ...pageTagNotes(callableSpec(docsContext, fn, {})),\n ]);\n};\n\nconst aliasPage = (entry: GiSymbolBase & { kind: \"alias\"; alias: GirAlias }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const category = entry.alias.cType === undefined ? undefined : primitiveCategory(entry.alias.cType);\n const target = category === \"gtype\" ? PRIMITIVE_TS_TYPE.gtype : renderTsType(docsContext, entry.alias.target);\n\n return joinSections([...pageHeader(entry, \"alias\"), `\\`\\`\\`ts\\ntype ${entry.name} = ${target}\\n\\`\\`\\``]);\n};\n\nconst functionSignature = (context: ModuleContext, name: string, fn: GirFunction, siblings: GirFunction[]): string => {\n const finishFn = matchStaticFinishFunction(context, fn, siblings);\n\n if (finishFn !== undefined) {\n const { signature, returnType } = renderPromisifiedSignature(context, fn, finishFn);\n\n return `function ${name}(${signature}): ${returnType}`;\n }\n\n return `function ${name}(${renderMethodSignature(context, fn)}): ${renderMethodReturnType(context, fn)}`;\n};\n\nconst functionPage = (entry: GiSymbolBase & { kind: \"function\"; fn: GirFunction }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const siblings = entry.namespace.functions;\n const signature = functionSignature(docsContext, entry.name, entry.fn, siblings);\n const finishFn = matchStaticFinishFunction(docsContext, entry.fn, siblings);\n const spec = callableSpec(docsContext, entry.fn, { finishFn });\n\n return joinSections([...pageHeader(entry, \"function\"), `\\`\\`\\`ts\\n${signature}\\n\\`\\`\\``, ...pageTagNotes(spec)]);\n};\n\nconst constantPage = (entry: GiSymbolBase & { kind: \"constant\"; constant: GirConstant }, library: Library): string => {\n const docsContext = docsSignatureContext(entry.namespace, library);\n const type = renderDocsType(library, entry.constant.type, false);\n\n return joinSections([\n ...pageHeader(entry, \"constant\"),\n `\\`\\`\\`ts\\nconst ${entry.name}: ${type} = ${constantLiteral(docsContext, entry.constant)}\\n\\`\\`\\``,\n ]);\n};\n\nexport { renderSymbolPage, type GiSymbolEntry, type SymbolPageOptions };\n"]}
|
package/dist/gir/class.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ type GirVirtualMethod = GirCallable & {
|
|
|
9
9
|
/** Method GIR names as invoking this slot, absent when the slot has no invoker. */
|
|
10
10
|
invoker: string | undefined;
|
|
11
11
|
};
|
|
12
|
+
/** A `<glib:signal>` on a class or interface. */
|
|
13
|
+
type GirSignal = GirCallable & {
|
|
14
|
+
/** Whether the signal takes a `::detail` suffix, so `changed::key` reaches only that detail. */
|
|
15
|
+
isDetailed: boolean;
|
|
16
|
+
};
|
|
12
17
|
/** A `<class>` or `<interface>` declared by a GIR namespace. */
|
|
13
18
|
type GirClass = {
|
|
14
19
|
/** Name GIR gives the type, without its namespace prefix. */
|
|
@@ -52,10 +57,10 @@ type GirClass = {
|
|
|
52
57
|
/** GObject properties the type declares. */
|
|
53
58
|
properties: GirProperty[];
|
|
54
59
|
/** GObject signals the type declares. */
|
|
55
|
-
signals:
|
|
60
|
+
signals: GirSignal[];
|
|
56
61
|
/** Virtual methods the type declares, carrying the documentation their vtable slots are generated from. */
|
|
57
62
|
vfuncs: GirVirtualMethod[];
|
|
58
63
|
};
|
|
59
64
|
declare const classFromNode: (node: RawNode, isInterface: boolean, context: ParseContext) => GirClass;
|
|
60
|
-
export { classFromNode, type GirClass, type GirVirtualMethod };
|
|
65
|
+
export { classFromNode, type GirClass, type GirSignal, type GirVirtualMethod };
|
|
61
66
|
//# sourceMappingURL=class.d.ts.map
|
package/dist/gir/class.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../src/gir/class.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAsD,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,eAAe,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AAS,CAAC;IAClC,sFAAsF;IACtF,WAAW,EAAE,OAAO,CAAC;IACrB,2DAA2D;IAC3D,UAAU,EAAE,OAAO,CAAC;IACpB,2EAA2E;IAC3E,WAAW,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,cAAc,EAAE,OAAO,CAAC;IACxB,uCAAuC;IACvC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gEAAgE;IAChE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,kCAAkC;IAClC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,0CAA0C;IAC1C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,iEAAiE;IACjE,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,4CAA4C;IAC5C,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,yCAAyC;IACzC,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,2GAA2G;IAC3G,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAQF,QAAA,MAAM,aAAa,GAAI,MAAM,OAAO,EAAE,aAAa,OAAO,EAAE,SAAS,YAAY,KAAG,QA4BlF,CAAC;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,CAAC"}
|
package/dist/gir/class.js
CHANGED
|
@@ -30,7 +30,10 @@ const classFromNode = (node, isInterface, context) => ({
|
|
|
30
30
|
constructors: getChildren(node, GIR_CONSTRUCTOR_TAG).map((ctor) => functionFromNode(ctor, context)),
|
|
31
31
|
functions: getChildren(node, "function").map((fn) => functionFromNode(fn, context)),
|
|
32
32
|
properties: getChildren(node, "property").map((property) => propertyFromNode(property, context)),
|
|
33
|
-
signals: getChildren(node, "glib:signal").map((signal) =>
|
|
33
|
+
signals: getChildren(node, "glib:signal").map((signal) => ({
|
|
34
|
+
...parseCallable(signal, context),
|
|
35
|
+
isDetailed: isAttrTrue(signal, "detailed"),
|
|
36
|
+
})),
|
|
34
37
|
vfuncs: virtualMethodsFromNode(node, context),
|
|
35
38
|
});
|
|
36
39
|
export { classFromNode };
|
package/dist/gir/class.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../src/gir/class.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAoB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAoB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAgB,MAAM,YAAY,CAAC;AAC9F,OAAO,EAAoB,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../src/gir/class.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAoB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAoB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAgB,MAAM,YAAY,CAAC;AAC9F,OAAO,EAAoB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AA8DnE,MAAM,sBAAsB,GAAG,CAAC,IAAa,EAAE,OAAqB,EAAsB,EAAE,CACxF,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAChD,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC;IAChC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC;CAClC,CAAC,CAAC,CAAC;AAER,MAAM,aAAa,GAAG,CAAC,IAAa,EAAE,WAAoB,EAAE,OAAqB,EAAY,EAA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YAAY,EAAE,WAAW,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnG,SAAS,EAAE,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACnF,UAAU,EAAE,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChG,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACvD,GAAG,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC;QACjC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC;KAC7C,CAAC,CAAC;IACH,MAAM,EAAE,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC;CAChD,CAAC,CAAC;AAEH,OAAO,EAAE,aAAa,EAAwD,CAAC","sourcesContent":["import type { ParseContext } from \"./type-id.js\";\nimport { documentedFromNode, type GirAnnotations } from \"./annotations.js\";\nimport { functionFromNode, type GirFunction } from \"./function.js\";\nimport { type GirCallable, parseCallable } from \"./parameter.js\";\nimport { attr, getChildren, GIR_CONSTRUCTOR_TAG, isAttrTrue, type RawNode } from \"./parse.js\";\nimport { type GirProperty, propertyFromNode } from \"./property.js\";\n\n/** A `<virtual-method>` on a class or interface: the vtable slot's own documentation and signature. */\ntype GirVirtualMethod = GirCallable & {\n /** Method GIR names as invoking this slot, absent when the slot has no invoker. */\n invoker: string | undefined;\n};\n\n/** A `<glib:signal>` on a class or interface. */\ntype GirSignal = GirCallable & {\n /** Whether the signal takes a `::detail` suffix, so `changed::key` reaches only that detail. */\n isDetailed: boolean;\n};\n\n/** A `<class>` or `<interface>` declared by a GIR namespace. */\ntype GirClass = {\n /** Name GIR gives the type, without its namespace prefix. */\n name: string;\n /** Documentation GIR carries for the type. */\n doc: string | undefined;\n /** Release and deprecation annotations GIR carries on the type. */\n annotations: GirAnnotations;\n /** C type of an instance, such as `GtkWidget`. */\n cType: string | undefined;\n /** The class it derives from, qualified when it lives in another namespace. */\n parent: string | undefined;\n /** GType name the type registers under, such as `GtkWidget`. */\n glibTypeName: string | undefined;\n /** C function returning the GType, such as `gtk_widget_get_type`. */\n glibGetType: string | undefined;\n /** Record holding the class or interface vtable, which virtual method bindings are laid out against. */\n glibTypeStruct: string | undefined;\n /** C function that takes a reference, on a type that manages its own refcount. */\n glibRefFunc: string | undefined;\n /** C function that drops a reference, on a type that manages its own refcount. */\n glibUnrefFunc: string | undefined;\n /** Whether the type is its own GType fundamental rather than a GObject descendant. */\n fundamental: boolean;\n /** Whether the class cannot be instantiated on its own. */\n isAbstract: boolean;\n /** Whether the type came from an `<interface>` rather than a `<class>`. */\n isInterface: boolean;\n /** Whether GIR exposes the type to bindings; codegen skips it when false. */\n introspectable: boolean;\n /** Interfaces the class implements. */\n implements: string[];\n /** Types an implementer of this interface must also provide. */\n prerequisites: string[];\n /** Methods taking an instance. */\n methods: GirFunction[];\n /** Functions returning a new instance. */\n constructors: GirFunction[];\n /** Functions namespaced under the type that take no instance. */\n functions: GirFunction[];\n /** GObject properties the type declares. */\n properties: GirProperty[];\n /** GObject signals the type declares. */\n signals: GirSignal[];\n /** Virtual methods the type declares, carrying the documentation their vtable slots are generated from. */\n vfuncs: GirVirtualMethod[];\n};\n\nconst virtualMethodsFromNode = (node: RawNode, context: ParseContext): GirVirtualMethod[] =>\n getChildren(node, \"virtual-method\").map((vfunc) => ({\n ...parseCallable(vfunc, context),\n invoker: attr(vfunc, \"invoker\"),\n }));\n\nconst classFromNode = (node: RawNode, isInterface: boolean, context: ParseContext): GirClass => ({\n ...documentedFromNode(node),\n cType: attr(node, \"c:type\"),\n parent: attr(node, \"parent\"),\n glibTypeName: attr(node, \"glib:type-name\"),\n glibGetType: attr(node, \"glib:get-type\"),\n glibTypeStruct: attr(node, \"glib:type-struct\"),\n glibRefFunc: attr(node, \"glib:ref-func\"),\n glibUnrefFunc: attr(node, \"glib:unref-func\"),\n fundamental: isAttrTrue(node, \"glib:fundamental\"),\n isAbstract: isAttrTrue(node, \"abstract\"),\n isInterface,\n introspectable: isAttrTrue(node, \"introspectable\", true),\n implements: getChildren(node, \"implements\")\n .map((implement) => attr(implement, \"name\"))\n .filter((name): name is string => name !== undefined),\n prerequisites: getChildren(node, \"prerequisite\")\n .map((prerequisite) => attr(prerequisite, \"name\"))\n .filter((name): name is string => name !== undefined),\n methods: getChildren(node, \"method\").map((method) => functionFromNode(method, context)),\n constructors: getChildren(node, GIR_CONSTRUCTOR_TAG).map((ctor) => functionFromNode(ctor, context)),\n functions: getChildren(node, \"function\").map((fn) => functionFromNode(fn, context)),\n properties: getChildren(node, \"property\").map((property) => propertyFromNode(property, context)),\n signals: getChildren(node, \"glib:signal\").map((signal) => ({\n ...parseCallable(signal, context),\n isDetailed: isAttrTrue(signal, \"detailed\"),\n })),\n vfuncs: virtualMethodsFromNode(node, context),\n});\n\nexport { classFromNode, type GirClass, type GirSignal, type GirVirtualMethod };\n"]}
|
|
@@ -7,7 +7,7 @@ import { renderJsDoc } from "../../writer/doc.js";
|
|
|
7
7
|
import { renderBlock, renderBraced, renderBracedOrEmpty } from "../../writer/emit.js";
|
|
8
8
|
import { dedupeCallables, generateBindings, instanceScope, isEmittableCallable, renderClassInstanceMember, renderInstanceMethodSignature, renderStaticHead, } from "./callables.js";
|
|
9
9
|
import { annotationSpec, getDoc } from "./doc-spec.js";
|
|
10
|
-
import { renderSourceGtype } from "./gtype-binding.js";
|
|
10
|
+
import { gtypeMemberDeclaration, renderSourceGtype } from "./gtype-binding.js";
|
|
11
11
|
import { methodExportName } from "./method.js";
|
|
12
12
|
import { renderPropertyAccessor, renderPropertyAccessorSignature, } from "./property-accessor.js";
|
|
13
13
|
import { appendInterfaceRegistration } from "./registration.js";
|
|
@@ -215,7 +215,7 @@ const renderInterfaceClass = (context, options) => {
|
|
|
215
215
|
const { iface, className, callables, gtypeExpr, implRef } = options;
|
|
216
216
|
const members = [];
|
|
217
217
|
if (gtypeExpr !== undefined) {
|
|
218
|
-
members.push(renderInterfaceHasInstance(context, className, gtypeExpr));
|
|
218
|
+
members.push(gtypeMemberDeclaration(context), renderInterfaceHasInstance(context, className, gtypeExpr));
|
|
219
219
|
}
|
|
220
220
|
members.push(...renderStaticHead(context, callables, className), renderInterfaceBrand(context, implRef));
|
|
221
221
|
return `${getDoc(iface)}${renderBracedOrEmpty(`export abstract class ${className}`, members.join("\n\n"))}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/store/gi/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAI1E,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAEH,eAAe,EACf,gBAAgB,EAGhB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,6BAA6B,EAC7B,gBAAgB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,e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entifier, sourceStringLiteral } from \"@gtkx/utils\";\nimport type { GirClass } from \"../../gir/class.js\";\nimport type { GirProperty } from \"../../gir/property.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport { reservedSignalMemberRename, resolvePrerequisiteReference } from \"../../analysis/inheritance.js\";\nimport { omittedTypeRef, prerequisiteConflicts } from \"../../analysis/interface-conflicts.js\";\nimport { resolveClassOrInterface, resolveInterfaces } from \"../../gir/ancestry.js\";\nimport { isEmittableEntity } from \"../../gir/emittable.js\";\nimport { renderJsDoc } from \"../../writer/doc.js\";\nimport { renderBlock, renderBraced, renderBracedOrEmpty } from \"../../writer/emit.js\";\nimport {\n type Callables,\n dedupeCallables,\n generateBindings,\n type InstanceMemberRenderer,\n type InstanceScope,\n instanceScope,\n isEmittableCallable,\n renderClassInstanceMember,\n renderInstanceMethodSignature,\n renderStaticHead,\n} from \"./callables.js\";\nimport { annotationSpec, getDoc } from \"./doc-spec.js\";\nimport { renderSourceGtype } from \"./gtype-binding.js\";\nimport { methodExportName } from \"./method.js\";\nimport {\n type PropertyAccessorArgs,\n renderPropertyAccessor,\n renderPropertyAccessorSignature,\n} from \"./property-accessor.js\";\nimport { appendInterfaceRegistration } from \"./registration.js\";\nimport { renderSignalDeclarations, renderSignalMembers } from \"./signal.js\";\nimport {\n hasCallableVfuncSlots,\n renderVfuncMembers,\n renderVfuncMetadata,\n type VfuncMemberMode,\n} from \"./vtable.js\";\n\ntype InterfaceMemberRenderers = {\n renderMethod: InstanceMemberRenderer;\n renderProperty: (args: PropertyAccessorArgs) => string | undefined;\n};\n\ntype MethodMemberOptions = {\n context: ModuleContext;\n className: string;\n scope: InstanceScope;\n callables: Callables;\n renderers: InterfaceMemberRenderers;\n claimedNames: Set<string>;\n};\n\ntype PropertyMemberOptions = {\n context: ModuleContext;\n iface: GirClass;\n scope: InstanceScope;\n renderers: InterfaceMemberRenderers;\n claimedNames: Set<string>;\n};\n\ntype InterfaceClassOptions = {\n iface: GirClass;\n className: string;\n callables: Callables;\n gtypeExpr: string | undefined;\n implRef: string;\n};\n\nconst BRAND_NOTE = [\n \"Phantom link to the type a class fills to adopt the interface, which `registerClass` reads\",\n \"through its `implements` option. It holds no value at runtime. `unknown` asks nothing of the\",\n \"class, which is what an interface with no slot to fill carries.\",\n].join(\"\\n\");\n\nconst generateInterface = (context: ModuleContext, iface: GirClass): void => {\n if (!isEmittableEntity(iface)) {\n return;\n }\n\n const className = sanitizeTypeIdentifier(iface.name);\n\n const callables: Callables = {\n constructors: dedupeCallables(iface.constructors),\n functions: dedupeCallables(iface.functions),\n methods: dedupeCallables(iface.methods),\n };\n\n generateBindings(context, callables);\n const gtypeExpr = renderSourceGtype(context, iface);\n const implRef = appendInterfaceTypes(context, iface, className, callables) ?? \"unknown\";\n const classCode = renderInterfaceClass(context, { iface, className, callables, gtypeExpr, implRef });\n context.declare({ name: className, code: classCode, owner: iface.name });\n\n for (const declaration of renderSignalDeclarations(context, iface, className, true)) {\n context.declare(declaration);\n }\n\n context.declare({\n name: makerName(className),\n code: renderInterfaceMaker(context, iface, className, callables),\n });\n\n appendInterfaceRegistration(context, {\n className,\n makerName: makerName(className),\n gtypeExpr,\n layout: renderInterfaceLayout(context, iface, callables),\n });\n};\n\nconst makerName = (className: string): string => `make${className}`;\n\nconst renderInterfaceLayout = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n): string | undefined => {\n const vfuncs = renderVfuncMetadata(context, iface);\n const properties = renderSlotBackedProperties(context, iface, callables);\n\n if (vfuncs === undefined && properties === undefined) {\n return undefined;\n }\n\n const entries: string[] = [];\n\n if (vfuncs !== undefined) {\n entries.push(`vfuncs: ${vfuncs},`);\n }\n\n if (properties !== undefined) {\n entries.push(`properties: ${properties},`);\n }\n\n return renderBraced(entries.join(\"\\n\"));\n};\n\nconst invokerMembers = (context: ModuleContext, iface: GirClass, callables: Callables): Map<string, string> => {\n const className = sanitizeTypeIdentifier(iface.name);\n\n const invokers: Set<string> = new Set(\n iface.vfuncs.map((vfunc) => vfunc.invoker).filter((invoker) => invoker !== undefined),\n );\n\n const members: Map<string, string> = new Map();\n\n for (const callable of callables.methods) {\n if (invokers.has(callable.name) && isEmittableCallable(context, callable)) {\n members.set(callable.name, reservedSignalMemberRename(className, callable) ?? methodExportName(callable));\n }\n }\n\n return members;\n};\n\nconst renderSlotAccessor = (\n key: string,\n method: string | undefined,\n members: Map<string, string>,\n): string | undefined => {\n const member = method === undefined ? undefined : members.get(method);\n\n return member === undefined ? undefined : `${key}: ${sourceStringLiteral(member)},`;\n};\n\nconst renderSlotBackedProperty = (property: GirProperty, members: Map<string, string>): string | undefined => {\n if (!property.introspectable) {\n return undefined;\n }\n\n const fields = [\n renderSlotAccessor(\"getter\", property.getter, members),\n renderSlotAccessor(\"setter\", property.setter, members),\n ].filter((field) => field !== undefined);\n\n if (fields.length === 0) {\n return undefined;\n }\n\n return `${sourceStringLiteral(property.name)}: ${renderBraced(fields.join(\"\\n\"))},`;\n};\n\nconst renderSlotBackedProperties = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n): string | undefined => {\n const members = invokerMembers(context, iface, callables);\n\n const entries = iface.properties\n .map((property) => renderSlotBackedProperty(property, members))\n .filter((entry) => entry !== undefined);\n\n return entries.length === 0 ? undefined : renderBraced(entries.join(\"\\n\"));\n};\n\nconst appendInterfaceTypes = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string | undefined => {\n const typeCode = renderInterfaceType(context, iface, className, callables);\n context.declare({ name: className, code: typeCode, owner: iface.name });\n const implType = renderInterfaceImplType(context, iface, className);\n\n if (implType === undefined) {\n return undefined;\n }\n\n const implName = implTypeName(className);\n context.declare({ name: implName, code: implType, owner: iface.name });\n\n return implName;\n};\n\nconst prerequisiteRef = (context: ModuleContext, iface: GirClass, name: string): string | undefined => {\n const ref = resolvePrerequisiteReference(context, name);\n const base = resolveClassOrInterface(context.library, context.namespace.name, name);\n\n if (ref === undefined || base === undefined) {\n return undefined;\n }\n\n return omittedTypeRef(ref, prerequisiteConflicts(context.library, iface, base));\n};\n\nconst rootPrerequisiteRef = (context: ModuleContext, iface: GirClass): string => {\n const ref = context.qualify(\"GObject\", \"Object\");\n const base = resolveClassOrInterface(context.library, \"GObject\", \"Object\");\n\n return base === undefined ? ref : omittedTypeRef(ref, prerequisiteConflicts(context.library, iface, base));\n};\n\nconst interfaceTypeExtends = (context: ModuleContext, iface: GirClass): string => {\n const refs = iface.prerequisites\n .map((name) => prerequisiteRef(context, iface, name))\n .filter((entry): entry is string => entry !== undefined);\n\n if (refs.length > 0) {\n return refs.join(\", \");\n }\n\n return rootPrerequisiteRef(context, iface);\n};\n\nconst renderInterfaceType = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string => {\n const members = renderInterfaceTypeMembers(context, iface, callables);\n\n return `${getDoc(iface)}${renderBracedOrEmpty(\n `export interface ${className} extends ${interfaceTypeExtends(context, iface)}`,\n members.join(\"\\n\"),\n )}`;\n};\n\nconst implTypeName = (className: string): string => `${className}Impl`;\n\nconst implTypeNote = (className: string): string =>\n [\n `Implementer side of \\`${className}\\`: the vtable slots a class fills to adopt the interface.`,\n \"\",\n `Declare it with \\`implements ${implTypeName(className)}\\` on a class passed to \\`registerClass\\``,\n `with \\`${className}\\` in \\`implements\\`. The interface's methods, properties, and signals come from`,\n \"GLib dispatch, so they are not part of this type.\",\n \"\",\n \"Every slot is optional: an unfilled one keeps whatever the interface installs by default, and a\",\n \"GIR update can add one. Declaring a slot pins its signature; declaring it as a class field rather\",\n \"than a method satisfies this type but never reaches the vtable.\",\n ].join(\"\\n\");\n\nconst implPrerequisiteRefs = (context: ModuleContext, iface: GirClass): string[] => {\n const prerequisites = resolveInterfaces(context.library, context.namespace.name, iface.prerequisites);\n const refs: string[] = [];\n\n for (const prerequisite of prerequisites) {\n if (!hasCallableVfuncSlots(context, prerequisite.namespaceName, prerequisite.klass)) {\n continue;\n }\n\n const name = implTypeName(sanitizeTypeIdentifier(prerequisite.klass.name));\n refs.push(context.qualify(prerequisite.namespaceName, name));\n }\n\n return refs;\n};\n\nconst implTypeExtends = (context: ModuleContext, iface: GirClass): string => {\n const refs = implPrerequisiteRefs(context, iface);\n\n return refs.length > 0 ? ` extends ${refs.join(\", \")}` : \"\";\n};\n\nconst interfaceVfuncMembers = (context: ModuleContext, iface: GirClass, mode: VfuncMemberMode): string[] =>\n renderVfuncMembers({ context, klass: iface, mode });\n\nconst renderInterfaceImplType = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n): string | undefined => {\n const members = interfaceVfuncMembers(context, iface, \"requirement\");\n\n if (members.length === 0) {\n return undefined;\n }\n\n return `${renderJsDoc(iface.doc, implTypeNote(className), annotationSpec(iface.annotations))}${renderBracedOrEmpty(\n `export interface ${implTypeName(className)}${implTypeExtends(context, iface)}`,\n members.join(\"\\n\"),\n )}`;\n};\n\nconst collectMethodMembers = (options: MethodMemberOptions): string[] => {\n const { context, className, scope, callables, renderers, claimedNames } = options;\n const members: string[] = [];\n\n for (const callable of callables.methods) {\n const rename = reservedSignalMemberRename(className, callable);\n const block = renderers.renderMethod(context, callable, scope, rename);\n\n if (block === undefined) {\n continue;\n }\n\n members.push(block);\n claimedNames.add(rename ?? methodExportName(callable));\n }\n\n return members;\n};\n\nconst collectPropertyMembers = (options: PropertyMemberOptions): string[] => {\n const { context, iface, renderers, claimedNames } = options;\n const members: string[] = [];\n\n for (const property of iface.properties) {\n const block = renderers.renderProperty({ context, property, claimedNames });\n\n if (block !== undefined) {\n members.push(block);\n }\n }\n\n return members;\n};\n\nconst renderInterfaceMembers = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n renderers: InterfaceMemberRenderers,\n): string[] => {\n const className = sanitizeTypeIdentifier(iface.name);\n const scope = instanceScope(className, callables);\n const claimedNames: Set<string> = new Set();\n const methodMembers = collectMethodMembers({ context, className, scope, callables, renderers, claimedNames });\n const propertyMembers = collectPropertyMembers({ context, iface, scope, renderers, claimedNames });\n\n return [...methodMembers, ...propertyMembers];\n};\n\nconst renderInterfaceTypeMembers = (context: ModuleContext, iface: GirClass, callables: Callables): string[] => [\n ...renderInterfaceMembers(context, iface, callables, {\n renderMethod: renderInstanceMethodSignature,\n renderProperty: renderPropertyAccessorSignature,\n }),\n ...interfaceVfuncMembers(context, iface, \"signature\"),\n];\n\nconst renderInterfaceClass = (context: ModuleContext, options: InterfaceClassOptions): string => {\n const { iface, className, callables, gtypeExpr, implRef } = options;\n const members: string[] = [];\n\n if (gtypeExpr !== undefined) {\n members.push(renderInterfaceHasInstance(context, className, gtypeExpr));\n }\n\n members.push(...renderStaticHead(context, callables, className), renderInterfaceBrand(context, implRef));\n\n return `${getDoc(iface)}${renderBracedOrEmpty(\n `export abstract class ${className}`,\n members.join(\"\\n\\n\"),\n )}`;\n};\n\nconst renderInterfaceBrand = (context: ModuleContext, implRef: string): string => {\n context.addRuntimeTypeImport(\"Interface\");\n\n return `${renderJsDoc(undefined, BRAND_NOTE)}declare static __impl__: Interface<${implRef}>[\"__impl__\"];`;\n};\n\nconst renderInterfaceHasInstance = (context: ModuleContext, className: string, gtypeExpr: string): string => {\n context.addRuntimeImport(\"valueIsA\");\n\n return renderBlock(\n `static [Symbol.hasInstance](value: unknown): value is ${className}`,\n `return valueIsA(value, ${gtypeExpr});`,\n );\n};\n\nconst renderInterfaceMaker = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string => {\n context.addRuntimeTypeImport(\"Mixin\");\n const members = renderInterfaceInstanceMembers(context, iface, callables);\n const classExpression = renderBracedOrEmpty(\"class extends Base\", members.join(\"\\n\\n\"));\n\n return `${getDoc(iface)}export const ${makerName(className)}: Mixin = (Base) =>\\n${classExpression};`;\n};\n\nconst renderInterfaceInstanceMembers = (context: ModuleContext, iface: GirClass, callables: Callables): string[] => [\n ...renderInterfaceMembers(context, iface, callables, {\n renderMethod: renderClassInstanceMember,\n renderProperty: renderPropertyAccessor,\n }),\n ...interfaceVfuncMembers(context, iface, \"implementation\"),\n ...renderSignalMembers(context, iface),\n];\n\nexport { generateInterface };\n"]}
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/store/gi/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAI1E,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAEH,eAAe,EACf,gBAAgB,EAGhB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,6BAA6B,EAC7B,gBAAgB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAEH,sBAAsB,EACtB,+BAA+B,GAClC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EACH,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,GAEtB,MAAM,aAAa,CAAC;AAgCrB,MAAM,UAAU,GAAG;IACf,4FAA4F;IAC5F,8FAA8F;IAC9F,iEAAiE;CACpE,CAAC,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ACtB,KAAe,EACf,SAAiB,EACjB,SAAoB,EACd,EAAE;IACR,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,8BAA8B,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAC1E,MAAM,eAAe,GAAG,mBAAmB,CAAC,oBAAoB,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAExF,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,gBAAgB,SAAS,CAAC,SAAS,CAAC,wBAAwB,eAAe,GAAG,CAAC;AAC1G,CAAC,CAAC;AAEF,MAAM,8BAA8B,GAAG,CAAC,OAAsB,EAAE,KAAe,EAAE,SAAoB,EAAY,EAAE,CAAC;IAChH,GAAG,sBAAsB,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;QACjD,YAAY,EAAE,yBAAyB;QACvC,cAAc,EAAE,sBAAsB;KACzC,CAAC;IACF,GAAG,qBAAqB,CAAC,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC;IAC1D,GAAG,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC;CACzC,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { sanitizeTypeIdentifier, sourceStringLiteral } from \"@gtkx/utils\";\nimport type { GirClass } from \"../../gir/class.js\";\nimport type { GirProperty } from \"../../gir/property.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport { reservedSignalMemberRename, resolvePrerequisiteReference } from \"../../analysis/inheritance.js\";\nimport { omittedTypeRef, prerequisiteConflicts } from \"../../analysis/interface-conflicts.js\";\nimport { resolveClassOrInterface, resolveInterfaces } from \"../../gir/ancestry.js\";\nimport { isEmittableEntity } from \"../../gir/emittable.js\";\nimport { renderJsDoc } from \"../../writer/doc.js\";\nimport { renderBlock, renderBraced, renderBracedOrEmpty } from \"../../writer/emit.js\";\nimport {\n type Callables,\n dedupeCallables,\n generateBindings,\n type InstanceMemberRenderer,\n type InstanceScope,\n instanceScope,\n isEmittableCallable,\n renderClassInstanceMember,\n renderInstanceMethodSignature,\n renderStaticHead,\n} from \"./callables.js\";\nimport { annotationSpec, getDoc } from \"./doc-spec.js\";\nimport { gtypeMemberDeclaration, renderSourceGtype } from \"./gtype-binding.js\";\nimport { methodExportName } from \"./method.js\";\nimport {\n type PropertyAccessorArgs,\n renderPropertyAccessor,\n renderPropertyAccessorSignature,\n} from \"./property-accessor.js\";\nimport { appendInterfaceRegistration } from \"./registration.js\";\nimport { renderSignalDeclarations, renderSignalMembers } from \"./signal.js\";\nimport {\n hasCallableVfuncSlots,\n renderVfuncMembers,\n renderVfuncMetadata,\n type VfuncMemberMode,\n} from \"./vtable.js\";\n\ntype InterfaceMemberRenderers = {\n renderMethod: InstanceMemberRenderer;\n renderProperty: (args: PropertyAccessorArgs) => string | undefined;\n};\n\ntype MethodMemberOptions = {\n context: ModuleContext;\n className: string;\n scope: InstanceScope;\n callables: Callables;\n renderers: InterfaceMemberRenderers;\n claimedNames: Set<string>;\n};\n\ntype PropertyMemberOptions = {\n context: ModuleContext;\n iface: GirClass;\n scope: InstanceScope;\n renderers: InterfaceMemberRenderers;\n claimedNames: Set<string>;\n};\n\ntype InterfaceClassOptions = {\n iface: GirClass;\n className: string;\n callables: Callables;\n gtypeExpr: string | undefined;\n implRef: string;\n};\n\nconst BRAND_NOTE = [\n \"Phantom link to the type a class fills to adopt the interface, which `registerClass` reads\",\n \"through its `implements` option. It holds no value at runtime. `unknown` asks nothing of the\",\n \"class, which is what an interface with no slot to fill carries.\",\n].join(\"\\n\");\n\nconst generateInterface = (context: ModuleContext, iface: GirClass): void => {\n if (!isEmittableEntity(iface)) {\n return;\n }\n\n const className = sanitizeTypeIdentifier(iface.name);\n\n const callables: Callables = {\n constructors: dedupeCallables(iface.constructors),\n functions: dedupeCallables(iface.functions),\n methods: dedupeCallables(iface.methods),\n };\n\n generateBindings(context, callables);\n const gtypeExpr = renderSourceGtype(context, iface);\n const implRef = appendInterfaceTypes(context, iface, className, callables) ?? \"unknown\";\n const classCode = renderInterfaceClass(context, { iface, className, callables, gtypeExpr, implRef });\n context.declare({ name: className, code: classCode, owner: iface.name });\n\n for (const declaration of renderSignalDeclarations(context, iface, className, true)) {\n context.declare(declaration);\n }\n\n context.declare({\n name: makerName(className),\n code: renderInterfaceMaker(context, iface, className, callables),\n });\n\n appendInterfaceRegistration(context, {\n className,\n makerName: makerName(className),\n gtypeExpr,\n layout: renderInterfaceLayout(context, iface, callables),\n });\n};\n\nconst makerName = (className: string): string => `make${className}`;\n\nconst renderInterfaceLayout = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n): string | undefined => {\n const vfuncs = renderVfuncMetadata(context, iface);\n const properties = renderSlotBackedProperties(context, iface, callables);\n\n if (vfuncs === undefined && properties === undefined) {\n return undefined;\n }\n\n const entries: string[] = [];\n\n if (vfuncs !== undefined) {\n entries.push(`vfuncs: ${vfuncs},`);\n }\n\n if (properties !== undefined) {\n entries.push(`properties: ${properties},`);\n }\n\n return renderBraced(entries.join(\"\\n\"));\n};\n\nconst invokerMembers = (context: ModuleContext, iface: GirClass, callables: Callables): Map<string, string> => {\n const className = sanitizeTypeIdentifier(iface.name);\n\n const invokers: Set<string> = new Set(\n iface.vfuncs.map((vfunc) => vfunc.invoker).filter((invoker) => invoker !== undefined),\n );\n\n const members: Map<string, string> = new Map();\n\n for (const callable of callables.methods) {\n if (invokers.has(callable.name) && isEmittableCallable(context, callable)) {\n members.set(callable.name, reservedSignalMemberRename(className, callable) ?? methodExportName(callable));\n }\n }\n\n return members;\n};\n\nconst renderSlotAccessor = (\n key: string,\n method: string | undefined,\n members: Map<string, string>,\n): string | undefined => {\n const member = method === undefined ? undefined : members.get(method);\n\n return member === undefined ? undefined : `${key}: ${sourceStringLiteral(member)},`;\n};\n\nconst renderSlotBackedProperty = (property: GirProperty, members: Map<string, string>): string | undefined => {\n if (!property.introspectable) {\n return undefined;\n }\n\n const fields = [\n renderSlotAccessor(\"getter\", property.getter, members),\n renderSlotAccessor(\"setter\", property.setter, members),\n ].filter((field) => field !== undefined);\n\n if (fields.length === 0) {\n return undefined;\n }\n\n return `${sourceStringLiteral(property.name)}: ${renderBraced(fields.join(\"\\n\"))},`;\n};\n\nconst renderSlotBackedProperties = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n): string | undefined => {\n const members = invokerMembers(context, iface, callables);\n\n const entries = iface.properties\n .map((property) => renderSlotBackedProperty(property, members))\n .filter((entry) => entry !== undefined);\n\n return entries.length === 0 ? undefined : renderBraced(entries.join(\"\\n\"));\n};\n\nconst appendInterfaceTypes = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string | undefined => {\n const typeCode = renderInterfaceType(context, iface, className, callables);\n context.declare({ name: className, code: typeCode, owner: iface.name });\n const implType = renderInterfaceImplType(context, iface, className);\n\n if (implType === undefined) {\n return undefined;\n }\n\n const implName = implTypeName(className);\n context.declare({ name: implName, code: implType, owner: iface.name });\n\n return implName;\n};\n\nconst prerequisiteRef = (context: ModuleContext, iface: GirClass, name: string): string | undefined => {\n const ref = resolvePrerequisiteReference(context, name);\n const base = resolveClassOrInterface(context.library, context.namespace.name, name);\n\n if (ref === undefined || base === undefined) {\n return undefined;\n }\n\n return omittedTypeRef(ref, prerequisiteConflicts(context.library, iface, base));\n};\n\nconst rootPrerequisiteRef = (context: ModuleContext, iface: GirClass): string => {\n const ref = context.qualify(\"GObject\", \"Object\");\n const base = resolveClassOrInterface(context.library, \"GObject\", \"Object\");\n\n return base === undefined ? ref : omittedTypeRef(ref, prerequisiteConflicts(context.library, iface, base));\n};\n\nconst interfaceTypeExtends = (context: ModuleContext, iface: GirClass): string => {\n const refs = iface.prerequisites\n .map((name) => prerequisiteRef(context, iface, name))\n .filter((entry): entry is string => entry !== undefined);\n\n if (refs.length > 0) {\n return refs.join(\", \");\n }\n\n return rootPrerequisiteRef(context, iface);\n};\n\nconst renderInterfaceType = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string => {\n const members = renderInterfaceTypeMembers(context, iface, callables);\n\n return `${getDoc(iface)}${renderBracedOrEmpty(\n `export interface ${className} extends ${interfaceTypeExtends(context, iface)}`,\n members.join(\"\\n\"),\n )}`;\n};\n\nconst implTypeName = (className: string): string => `${className}Impl`;\n\nconst implTypeNote = (className: string): string =>\n [\n `Implementer side of \\`${className}\\`: the vtable slots a class fills to adopt the interface.`,\n \"\",\n `Declare it with \\`implements ${implTypeName(className)}\\` on a class passed to \\`registerClass\\``,\n `with \\`${className}\\` in \\`implements\\`. The interface's methods, properties, and signals come from`,\n \"GLib dispatch, so they are not part of this type.\",\n \"\",\n \"Every slot is optional: an unfilled one keeps whatever the interface installs by default, and a\",\n \"GIR update can add one. Declaring a slot pins its signature; declaring it as a class field rather\",\n \"than a method satisfies this type but never reaches the vtable.\",\n ].join(\"\\n\");\n\nconst implPrerequisiteRefs = (context: ModuleContext, iface: GirClass): string[] => {\n const prerequisites = resolveInterfaces(context.library, context.namespace.name, iface.prerequisites);\n const refs: string[] = [];\n\n for (const prerequisite of prerequisites) {\n if (!hasCallableVfuncSlots(context, prerequisite.namespaceName, prerequisite.klass)) {\n continue;\n }\n\n const name = implTypeName(sanitizeTypeIdentifier(prerequisite.klass.name));\n refs.push(context.qualify(prerequisite.namespaceName, name));\n }\n\n return refs;\n};\n\nconst implTypeExtends = (context: ModuleContext, iface: GirClass): string => {\n const refs = implPrerequisiteRefs(context, iface);\n\n return refs.length > 0 ? ` extends ${refs.join(\", \")}` : \"\";\n};\n\nconst interfaceVfuncMembers = (context: ModuleContext, iface: GirClass, mode: VfuncMemberMode): string[] =>\n renderVfuncMembers({ context, klass: iface, mode });\n\nconst renderInterfaceImplType = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n): string | undefined => {\n const members = interfaceVfuncMembers(context, iface, \"requirement\");\n\n if (members.length === 0) {\n return undefined;\n }\n\n return `${renderJsDoc(iface.doc, implTypeNote(className), annotationSpec(iface.annotations))}${renderBracedOrEmpty(\n `export interface ${implTypeName(className)}${implTypeExtends(context, iface)}`,\n members.join(\"\\n\"),\n )}`;\n};\n\nconst collectMethodMembers = (options: MethodMemberOptions): string[] => {\n const { context, className, scope, callables, renderers, claimedNames } = options;\n const members: string[] = [];\n\n for (const callable of callables.methods) {\n const rename = reservedSignalMemberRename(className, callable);\n const block = renderers.renderMethod(context, callable, scope, rename);\n\n if (block === undefined) {\n continue;\n }\n\n members.push(block);\n claimedNames.add(rename ?? methodExportName(callable));\n }\n\n return members;\n};\n\nconst collectPropertyMembers = (options: PropertyMemberOptions): string[] => {\n const { context, iface, renderers, claimedNames } = options;\n const members: string[] = [];\n\n for (const property of iface.properties) {\n const block = renderers.renderProperty({ context, property, claimedNames });\n\n if (block !== undefined) {\n members.push(block);\n }\n }\n\n return members;\n};\n\nconst renderInterfaceMembers = (\n context: ModuleContext,\n iface: GirClass,\n callables: Callables,\n renderers: InterfaceMemberRenderers,\n): string[] => {\n const className = sanitizeTypeIdentifier(iface.name);\n const scope = instanceScope(className, callables);\n const claimedNames: Set<string> = new Set();\n const methodMembers = collectMethodMembers({ context, className, scope, callables, renderers, claimedNames });\n const propertyMembers = collectPropertyMembers({ context, iface, scope, renderers, claimedNames });\n\n return [...methodMembers, ...propertyMembers];\n};\n\nconst renderInterfaceTypeMembers = (context: ModuleContext, iface: GirClass, callables: Callables): string[] => [\n ...renderInterfaceMembers(context, iface, callables, {\n renderMethod: renderInstanceMethodSignature,\n renderProperty: renderPropertyAccessorSignature,\n }),\n ...interfaceVfuncMembers(context, iface, \"signature\"),\n];\n\nconst renderInterfaceClass = (context: ModuleContext, options: InterfaceClassOptions): string => {\n const { iface, className, callables, gtypeExpr, implRef } = options;\n const members: string[] = [];\n\n if (gtypeExpr !== undefined) {\n members.push(gtypeMemberDeclaration(context), renderInterfaceHasInstance(context, className, gtypeExpr));\n }\n\n members.push(...renderStaticHead(context, callables, className), renderInterfaceBrand(context, implRef));\n\n return `${getDoc(iface)}${renderBracedOrEmpty(\n `export abstract class ${className}`,\n members.join(\"\\n\\n\"),\n )}`;\n};\n\nconst renderInterfaceBrand = (context: ModuleContext, implRef: string): string => {\n context.addRuntimeTypeImport(\"Interface\");\n\n return `${renderJsDoc(undefined, BRAND_NOTE)}declare static __impl__: Interface<${implRef}>[\"__impl__\"];`;\n};\n\nconst renderInterfaceHasInstance = (context: ModuleContext, className: string, gtypeExpr: string): string => {\n context.addRuntimeImport(\"valueIsA\");\n\n return renderBlock(\n `static [Symbol.hasInstance](value: unknown): value is ${className}`,\n `return valueIsA(value, ${gtypeExpr});`,\n );\n};\n\nconst renderInterfaceMaker = (\n context: ModuleContext,\n iface: GirClass,\n className: string,\n callables: Callables,\n): string => {\n context.addRuntimeTypeImport(\"Mixin\");\n const members = renderInterfaceInstanceMembers(context, iface, callables);\n const classExpression = renderBracedOrEmpty(\"class extends Base\", members.join(\"\\n\\n\"));\n\n return `${getDoc(iface)}export const ${makerName(className)}: Mixin = (Base) =>\\n${classExpression};`;\n};\n\nconst renderInterfaceInstanceMembers = (context: ModuleContext, iface: GirClass, callables: Callables): string[] => [\n ...renderInterfaceMembers(context, iface, callables, {\n renderMethod: renderClassInstanceMember,\n renderProperty: renderPropertyAccessor,\n }),\n ...interfaceVfuncMembers(context, iface, \"implementation\"),\n ...renderSignalMembers(context, iface),\n];\n\nexport { generateInterface };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-constructor.d.ts","sourceRoot":"","sources":["../../../src/store/gi/record-constructor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAS/D,KAAK,qBAAqB,GAAG;IACzB,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC5B,CAAC;
|
|
1
|
+
{"version":3,"file":"record-constructor.d.ts","sourceRoot":"","sources":["../../../src/store/gi/record-constructor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAS/D,KAAK,qBAAqB,GAAG;IACzB,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC5B,CAAC;AAOF,QAAA,MAAM,qCAAqC,GACvC,SAAS,aAAa,EACtB,QAAQ,SAAS,EACjB,WAAW,MAAM,KAClB,MAaF,CAAC;AA0DF,QAAA,MAAM,uBAAuB,GAAI,SAAS,aAAa,EAAE,MAAM,qBAAqB,KAAG,MAyBtF,CAAC;AA+BF,OAAO,EAAE,qCAAqC,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -6,10 +6,12 @@ import { renderBlock, renderBracedOrEmpty } from "../../writer/emit.js";
|
|
|
6
6
|
import { staticMembers } from "./callables.js";
|
|
7
7
|
import { getDoc } from "./doc-spec.js";
|
|
8
8
|
import { renderSourceGtype } from "./gtype-binding.js";
|
|
9
|
-
import { emitFieldWrite, isEmittableField, isInlineField } from "./record-field-accessor.js";
|
|
9
|
+
import { emitFieldWrite, isEmittableField, isInlineField, isStorableFieldType } from "./record-field-accessor.js";
|
|
10
10
|
import { computeRecordFieldSlots } from "./record-layout.js";
|
|
11
11
|
import { isConstructibleRecord } from "./value-marshalable.js";
|
|
12
|
-
const isWritableFieldSlot = (context, entry) => entry.field.writable &&
|
|
12
|
+
const isWritableFieldSlot = (context, entry) => entry.field.writable &&
|
|
13
|
+
isEmittableField(context, entry.field) &&
|
|
14
|
+
isStorableFieldType(context, entry.field.type);
|
|
13
15
|
const renderRecordConstructorPropsInterface = (context, record, className) => {
|
|
14
16
|
const head = `export interface ${className}ConstructorProps`;
|
|
15
17
|
const { slots } = computeRecordFieldSlots(context, record.fields, record.isUnion);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-constructor.js","sourceRoot":"","sources":["../../../src/store/gi/record-constructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAMrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAkB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAwB,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAW/D,MAAM,mBAAmB,GAAG,CAAC,OAAsB,EAAE,KAAsB,EAA8B,EAAE,CACvG,KAAK,CAAC,KAAK,CAAC,QAAQ,IAAI,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;AAEnE,MAAM,qCAAqC,GAAG,CAC1C,OAAsB,EACtB,MAAiB,EACjB,SAAiB,EACX,EAAE;IACR,MAAM,IAAI,GAAG,oBAAoB,SAAS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,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CACzG,CAAC;IAEF,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEjD,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,EAAE;QAClC,UAAU;QACV,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,UAAU,EAAE,UAAU;QACtB,SAAS,EAAE,SAAS,IAAI,EAAE;KAC7B,CAAC,CAAC;IAEH,OAAO,aAAa,IAAI,mBAAmB,KAAK,EAAE,CAAC;AACvD,CAAC,CAAC;AAEF,OAAO,EAAE,qCAAqC,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import { sourceStringLiteral, toCamelIdentifier } from \"@gtkx/utils\";\nimport type { GirField } from \"../../gir/field.js\";\nimport type { GirFunction } from \"../../gir/function.js\";\nimport type { GirRecord } from \"../../gir/record.js\";\nimport type { TypeId } from \"../../gir/type-id.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport { renderDescriptor } from \"../../analysis/descriptor-render.js\";\nimport { inputParameters, parameterIdentifier } from \"../../analysis/param-structure.js\";\nimport { renderTsType } from \"../../analysis/ts-type.js\";\nimport { renderBlock, renderBracedOrEmpty } from \"../../writer/emit.js\";\nimport { type Callables, staticMembers } from \"./callables.js\";\nimport { getDoc } from \"./doc-spec.js\";\nimport { renderSourceGtype } from \"./gtype-binding.js\";\nimport { emitFieldWrite, isEmittableField, isInlineField } from \"./record-field-accessor.js\";\nimport { computeRecordFieldSlots, type RecordFieldSlot } from \"./record-layout.js\";\nimport { isConstructibleRecord } from \"./value-marshalable.js\";\n\ntype WritableFieldSlot = RecordFieldSlot & { field: GirField & { type: TypeId } };\n\ntype RecordConstructorSpec = {\n record: GirRecord;\n className: string;\n callables: Callables;\n isErrorSubclass: boolean;\n};\n\nconst isWritableFieldSlot = (context: ModuleContext, entry: RecordFieldSlot): entry is WritableFieldSlot =>\n entry.field.writable && isEmittableField(context, entry.field);\n\nconst renderRecordConstructorPropsInterface = (\n context: ModuleContext,\n record: GirRecord,\n className: string,\n): string => {\n const head = `export interface ${className}ConstructorProps`;\n const { slots } = computeRecordFieldSlots(context, record.fields, record.isUnion);\n\n const lines = slots\n .filter((entry): entry is WritableFieldSlot => isWritableFieldSlot(context, entry))\n .map(\n (entry) =>\n `${getDoc(entry.field)}${toCamelIdentifier(entry.field.name)}?: ` +\n `${renderTsType(context, entry.field.type, true)};`,\n );\n\n return renderBracedOrEmpty(head, lines.join(\"\\n\"));\n};\n\nconst isSelfReturning = (context: ModuleContext, record: GirRecord, callable: GirFunction): boolean => {\n const ref = callable.returnValue.type;\n const name = ref === undefined ? undefined : context.library.nameFor(ref);\n\n return name?.namespaceName === context.namespace.name && name.typeName === record.name;\n};\n\nconst renderStaticCall = (context: ModuleContext, callable: GirFunction, name: string): string => {\n const args = inputParameters(context.library, callable).map(({ parameter, index }) =>\n parameterIdentifier(parameter, index));\n\n return `${name}(${args.join(\", \")})`;\n};\n\nconst constructionHint = (context: ModuleContext, spec: RecordConstructorSpec): string | undefined => {\n const candidates = staticMembers(context, spec.callables).filter(({ callable }) =>\n isSelfReturning(context, spec.record, callable));\n\n const candidate = candidates.find(({ name }) => name === \"new\") ?? candidates[0];\n\n return candidate === undefined ? undefined : renderStaticCall(context, candidate.callable, candidate.name);\n};\n\nconst unconstructibleMessage = (context: ModuleContext, spec: RecordConstructorSpec): string => {\n const qualified = `${context.namespace.name}.${spec.className}`;\n const hint = constructionHint(context, spec);\n\n return hint === undefined\n ? `Cannot construct ${qualified} with new: its instances come from the functions that return them.`\n : `Cannot construct ${qualified} with new: use ${qualified}.${hint} instead.`;\n};\n\nconst renderUnconstructibleGuard = (context: ModuleContext, spec: RecordConstructorSpec): string => {\n const superCall = spec.isErrorSubclass ? [\"super();\"] : [];\n const message = sourceStringLiteral(unconstructibleMessage(context, spec));\n\n return renderBlock(\"constructor()\", [...superCall, `throw new globalThis.Error(${message});`].join(\"\\n\"));\n};\n\nconst renderEmptyConstructor = (className: string, isErrorSubclass: boolean): string =>\n isErrorSubclass\n ? renderBlock(`constructor(props: ${className}ConstructorProps = {})`, \"super();\")\n : `constructor(props: ${className}ConstructorProps = {}) {}`;\n\nconst renderFieldWrites = (context: ModuleContext, slots: RecordFieldSlot[]): string[] => {\n const statements: string[] = [];\n\n for (const entry of slots) {\n if (isWritableFieldSlot(context, entry)) {\n statements.push(renderFieldWrite(context, entry));\n }\n }\n\n return statements;\n};\n\nconst renderRecordConstructor = (context: ModuleContext, spec: RecordConstructorSpec): string => {\n const { record, className, isErrorSubclass } = spec;\n\n if (!isConstructibleRecord(context, context.namespace.name, record)) {\n return renderUnconstructibleGuard(context, spec);\n }\n\n const superCall = isErrorSubclass ? [\"super();\"] : [];\n const { slots, size } = computeRecordFieldSlots(context, record.fields, record.isUnion);\n\n if (size === 0) {\n return renderEmptyConstructor(className, isErrorSubclass);\n }\n\n context.addRuntimeImport(\"alloc\");\n context.addRuntimeImport(\"setHandle\");\n\n const statements = [\n ...superCall,\n `const __handle = alloc(${allocArgs(context, record, size).join(\", \")});`,\n ...renderFieldWrites(context, slots),\n \"setHandle(this, __handle);\",\n ];\n\n return renderBlock(`constructor(props: ${className}ConstructorProps = {})`, statements.join(\"\\n\"));\n};\n\nconst allocArgs = (context: ModuleContext, record: GirRecord, size: number): string[] => {\n const args = [String(size)];\n\n if (renderSourceGtype(context, record) !== undefined) {\n args.push(\"this.__type__\");\n }\n\n return args;\n};\n\nconst renderFieldWrite = (context: ModuleContext, entry: WritableFieldSlot): string => {\n context.addRuntimeImport(\"t\");\n\n const descriptor = context.hoistDescriptor(\n renderDescriptor(context, entry.field.type, \"none\", { isInline: isInlineField(context, entry.field) }),\n );\n\n const name = toCamelIdentifier(entry.field.name);\n\n const write = emitFieldWrite(context, {\n descriptor,\n slot: entry.slot,\n targetExpr: \"__handle\",\n valueExpr: `props.${name}`,\n });\n\n return `if (props.${name} !== undefined) ${write}`;\n};\n\nexport { renderRecordConstructorPropsInterface, renderRecordConstructor };\n"]}
|
|
1
|
+
{"version":3,"file":"record-constructor.js","sourceRoot":"","sources":["../../../src/store/gi/record-constructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAMrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAkB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAClH,OAAO,EAAE,uBAAuB,EAAwB,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAW/D,MAAM,mBAAmB,GAAG,CAAC,OAAsB,EAAE,KAAsB,EAA8B,EAAE,CACvG,KAAK,CAAC,KAAK,CAAC,QAAQ;IACpB,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC;IACtC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAEnD,MAAM,qCAAqC,GAAG,CAC1C,OAAsB,EACtB,MAAiB,EACjB,SAAiB,EACX,EAAE;IACR,MAAM,IAAI,GAAG,oBAAoB,SA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tC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CACzG,CAAC;IAEF,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEjD,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,EAAE;QAClC,UAAU;QACV,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,UAAU,EAAE,UAAU;QACtB,SAAS,EAAE,SAAS,IAAI,EAAE;KAC7B,CAAC,CAAC;IAEH,OAAO,aAAa,IAAI,mBAAmB,KAAK,EAAE,CAAC;AACvD,CAAC,CAAC;AAEF,OAAO,EAAE,qCAAqC,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import { sourceStringLiteral, toCamelIdentifier } from \"@gtkx/utils\";\nimport type { GirField } from \"../../gir/field.js\";\nimport type { GirFunction } from \"../../gir/function.js\";\nimport type { GirRecord } from \"../../gir/record.js\";\nimport type { TypeId } from \"../../gir/type-id.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport { renderDescriptor } from \"../../analysis/descriptor-render.js\";\nimport { inputParameters, parameterIdentifier } from \"../../analysis/param-structure.js\";\nimport { renderTsType } from \"../../analysis/ts-type.js\";\nimport { renderBlock, renderBracedOrEmpty } from \"../../writer/emit.js\";\nimport { type Callables, staticMembers } from \"./callables.js\";\nimport { getDoc } from \"./doc-spec.js\";\nimport { renderSourceGtype } from \"./gtype-binding.js\";\nimport { emitFieldWrite, isEmittableField, isInlineField, isStorableFieldType } from \"./record-field-accessor.js\";\nimport { computeRecordFieldSlots, type RecordFieldSlot } from \"./record-layout.js\";\nimport { isConstructibleRecord } from \"./value-marshalable.js\";\n\ntype WritableFieldSlot = RecordFieldSlot & { field: GirField & { type: TypeId } };\n\ntype RecordConstructorSpec = {\n record: GirRecord;\n className: string;\n callables: Callables;\n isErrorSubclass: boolean;\n};\n\nconst isWritableFieldSlot = (context: ModuleContext, entry: RecordFieldSlot): entry is WritableFieldSlot =>\n entry.field.writable &&\n isEmittableField(context, entry.field) &&\n isStorableFieldType(context, entry.field.type);\n\nconst renderRecordConstructorPropsInterface = (\n context: ModuleContext,\n record: GirRecord,\n className: string,\n): string => {\n const head = `export interface ${className}ConstructorProps`;\n const { slots } = computeRecordFieldSlots(context, record.fields, record.isUnion);\n\n const lines = slots\n .filter((entry): entry is WritableFieldSlot => isWritableFieldSlot(context, entry))\n .map(\n (entry) =>\n `${getDoc(entry.field)}${toCamelIdentifier(entry.field.name)}?: ` +\n `${renderTsType(context, entry.field.type, true)};`,\n );\n\n return renderBracedOrEmpty(head, lines.join(\"\\n\"));\n};\n\nconst isSelfReturning = (context: ModuleContext, record: GirRecord, callable: GirFunction): boolean => {\n const ref = callable.returnValue.type;\n const name = ref === undefined ? undefined : context.library.nameFor(ref);\n\n return name?.namespaceName === context.namespace.name && name.typeName === record.name;\n};\n\nconst renderStaticCall = (context: ModuleContext, callable: GirFunction, name: string): string => {\n const args = inputParameters(context.library, callable).map(({ parameter, index }) =>\n parameterIdentifier(parameter, index));\n\n return `${name}(${args.join(\", \")})`;\n};\n\nconst constructionHint = (context: ModuleContext, spec: RecordConstructorSpec): string | undefined => {\n const candidates = staticMembers(context, spec.callables).filter(({ callable }) =>\n isSelfReturning(context, spec.record, callable));\n\n const candidate = candidates.find(({ name }) => name === \"new\") ?? candidates[0];\n\n return candidate === undefined ? undefined : renderStaticCall(context, candidate.callable, candidate.name);\n};\n\nconst unconstructibleMessage = (context: ModuleContext, spec: RecordConstructorSpec): string => {\n const qualified = `${context.namespace.name}.${spec.className}`;\n const hint = constructionHint(context, spec);\n\n return hint === undefined\n ? `Cannot construct ${qualified} with new: its instances come from the functions that return them.`\n : `Cannot construct ${qualified} with new: use ${qualified}.${hint} instead.`;\n};\n\nconst renderUnconstructibleGuard = (context: ModuleContext, spec: RecordConstructorSpec): string => {\n const superCall = spec.isErrorSubclass ? [\"super();\"] : [];\n const message = sourceStringLiteral(unconstructibleMessage(context, spec));\n\n return renderBlock(\"constructor()\", [...superCall, `throw new globalThis.Error(${message});`].join(\"\\n\"));\n};\n\nconst renderEmptyConstructor = (className: string, isErrorSubclass: boolean): string =>\n isErrorSubclass\n ? renderBlock(`constructor(props: ${className}ConstructorProps = {})`, \"super();\")\n : `constructor(props: ${className}ConstructorProps = {}) {}`;\n\nconst renderFieldWrites = (context: ModuleContext, slots: RecordFieldSlot[]): string[] => {\n const statements: string[] = [];\n\n for (const entry of slots) {\n if (isWritableFieldSlot(context, entry)) {\n statements.push(renderFieldWrite(context, entry));\n }\n }\n\n return statements;\n};\n\nconst renderRecordConstructor = (context: ModuleContext, spec: RecordConstructorSpec): string => {\n const { record, className, isErrorSubclass } = spec;\n\n if (!isConstructibleRecord(context, context.namespace.name, record)) {\n return renderUnconstructibleGuard(context, spec);\n }\n\n const superCall = isErrorSubclass ? [\"super();\"] : [];\n const { slots, size } = computeRecordFieldSlots(context, record.fields, record.isUnion);\n\n if (size === 0) {\n return renderEmptyConstructor(className, isErrorSubclass);\n }\n\n context.addRuntimeImport(\"alloc\");\n context.addRuntimeImport(\"setHandle\");\n\n const statements = [\n ...superCall,\n `const __handle = alloc(${allocArgs(context, record, size).join(\", \")});`,\n ...renderFieldWrites(context, slots),\n \"setHandle(this, __handle);\",\n ];\n\n return renderBlock(`constructor(props: ${className}ConstructorProps = {})`, statements.join(\"\\n\"));\n};\n\nconst allocArgs = (context: ModuleContext, record: GirRecord, size: number): string[] => {\n const args = [String(size)];\n\n if (renderSourceGtype(context, record) !== undefined) {\n args.push(\"this.__type__\");\n }\n\n return args;\n};\n\nconst renderFieldWrite = (context: ModuleContext, entry: WritableFieldSlot): string => {\n context.addRuntimeImport(\"t\");\n\n const descriptor = context.hoistDescriptor(\n renderDescriptor(context, entry.field.type, \"none\", { isInline: isInlineField(context, entry.field) }),\n );\n\n const name = toCamelIdentifier(entry.field.name);\n\n const write = emitFieldWrite(context, {\n descriptor,\n slot: entry.slot,\n targetExpr: \"__handle\",\n valueExpr: `props.${name}`,\n });\n\n return `if (props.${name} !== undefined) ${write}`;\n};\n\nexport { renderRecordConstructorPropsInterface, renderRecordConstructor };\n"]}
|
|
@@ -21,8 +21,9 @@ declare const isEmittableField: (context: ModuleContext, field: GirField) => fie
|
|
|
21
21
|
type: TypeId;
|
|
22
22
|
};
|
|
23
23
|
declare const emitFieldWrite: (context: ModuleContext, spec: FieldWriteSpec) => string;
|
|
24
|
-
declare const
|
|
24
|
+
declare const isStorableFieldType: (context: ModuleContext, ref: TypeId) => boolean;
|
|
25
|
+
declare const resolveRecordFieldEntry: (context: ModuleContext, slot: RecordFieldSlot, claimedNames: Set<string>, siblingFields: GirField[]) => RecordFieldEntry | undefined;
|
|
25
26
|
declare const renderRecordFieldAccessor: (context: ModuleContext, slot: RecordFieldSlot, claimedNames: Set<string>, siblingFields: GirField[]) => string | undefined;
|
|
26
27
|
declare const isInlineField: (context: ModuleContext, field: GirField) => boolean;
|
|
27
|
-
export { isEmittableField, isInlineField, emitFieldWrite, resolveRecordFieldEntry, renderRecordFieldAccessor, };
|
|
28
|
+
export { isEmittableField, isInlineField, isStorableFieldType, emitFieldWrite, resolveRecordFieldEntry, renderRecordFieldAccessor, };
|
|
28
29
|
//# sourceMappingURL=record-field-accessor.d.ts.map
|