@gtkx/runtime 1.2.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +6 -4
  2. package/dist/arg.d.ts +6 -1
  3. package/dist/arg.d.ts.map +1 -1
  4. package/dist/arg.js +2 -1
  5. package/dist/arg.js.map +1 -1
  6. package/dist/closure.d.ts.map +1 -1
  7. package/dist/closure.js +2 -11
  8. package/dist/closure.js.map +1 -1
  9. package/dist/descriptors.d.ts +21 -3
  10. package/dist/descriptors.d.ts.map +1 -1
  11. package/dist/descriptors.js +50 -21
  12. package/dist/descriptors.js.map +1 -1
  13. package/dist/field.d.ts +42 -0
  14. package/dist/field.d.ts.map +1 -0
  15. package/dist/field.js +41 -0
  16. package/dist/field.js.map +1 -0
  17. package/dist/fn.d.ts +2 -0
  18. package/dist/fn.d.ts.map +1 -1
  19. package/dist/fn.js +50 -10
  20. package/dist/fn.js.map +1 -1
  21. package/dist/index.d.ts +14 -6
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +13 -5
  24. package/dist/index.js.map +1 -1
  25. package/dist/mixin.d.ts +2 -1
  26. package/dist/mixin.d.ts.map +1 -1
  27. package/dist/mixin.js +1 -1
  28. package/dist/mixin.js.map +1 -1
  29. package/dist/native-value.d.ts +9 -3
  30. package/dist/native-value.d.ts.map +1 -1
  31. package/dist/native-value.js +86 -9
  32. package/dist/native-value.js.map +1 -1
  33. package/dist/object.d.ts +14 -6
  34. package/dist/object.d.ts.map +1 -1
  35. package/dist/object.js +21 -10
  36. package/dist/object.js.map +1 -1
  37. package/dist/param-spec.d.ts +32 -1
  38. package/dist/param-spec.d.ts.map +1 -1
  39. package/dist/param-spec.js +67 -5
  40. package/dist/param-spec.js.map +1 -1
  41. package/dist/promisify.d.ts +13 -1
  42. package/dist/promisify.d.ts.map +1 -1
  43. package/dist/promisify.js +14 -1
  44. package/dist/promisify.js.map +1 -1
  45. package/dist/properties.d.ts +48 -5
  46. package/dist/properties.d.ts.map +1 -1
  47. package/dist/properties.js +191 -20
  48. package/dist/properties.js.map +1 -1
  49. package/dist/regex.d.ts +25 -0
  50. package/dist/regex.d.ts.map +1 -0
  51. package/dist/regex.js +59 -0
  52. package/dist/regex.js.map +1 -0
  53. package/dist/register-class.d.ts +165 -15
  54. package/dist/register-class.d.ts.map +1 -1
  55. package/dist/register-class.js +175 -19
  56. package/dist/register-class.js.map +1 -1
  57. package/dist/registry.d.ts +48 -4
  58. package/dist/registry.d.ts.map +1 -1
  59. package/dist/registry.js +147 -3
  60. package/dist/registry.js.map +1 -1
  61. package/dist/signal.d.ts +11 -1
  62. package/dist/signal.d.ts.map +1 -1
  63. package/dist/signal.js +66 -6
  64. package/dist/signal.js.map +1 -1
  65. package/dist/t.d.ts +11 -0
  66. package/dist/t.d.ts.map +1 -1
  67. package/dist/t.js +3 -0
  68. package/dist/t.js.map +1 -1
  69. package/dist/type.d.ts +2 -1
  70. package/dist/type.d.ts.map +1 -1
  71. package/dist/type.js +5 -1
  72. package/dist/type.js.map +1 -1
  73. package/dist/value.d.ts +48 -4
  74. package/dist/value.d.ts.map +1 -1
  75. package/dist/value.js +172 -16
  76. package/dist/value.js.map +1 -1
  77. package/dist/variant.d.ts +75 -26
  78. package/dist/variant.d.ts.map +1 -1
  79. package/dist/variant.js +44 -29
  80. package/dist/variant.js.map +1 -1
  81. package/package.json +5 -5
  82. package/src/arg.ts +6 -1
  83. package/src/closure.ts +2 -14
  84. package/src/descriptors.ts +74 -21
  85. package/src/field.ts +76 -0
  86. package/src/fn.ts +73 -17
  87. package/src/index.ts +46 -5
  88. package/src/mixin.ts +1 -1
  89. package/src/native-value.ts +146 -14
  90. package/src/object.ts +23 -11
  91. package/src/param-spec.ts +96 -8
  92. package/src/promisify.ts +27 -1
  93. package/src/properties.ts +280 -32
  94. package/src/regex.ts +92 -0
  95. package/src/register-class.ts +485 -42
  96. package/src/registry.ts +219 -4
  97. package/src/signal.ts +117 -4
  98. package/src/t.ts +13 -0
  99. package/src/type.ts +7 -0
  100. package/src/value.ts +268 -14
  101. package/src/variant.ts +184 -53
@@ -1 +1 @@
1
- {"version":3,"file":"properties.js","sourceRoot":"","sources":["../src/properties.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACH,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EAEf,aAAa,EACb,qBAAqB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,iBAAiB,EAA0B,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EACH,SAAS,EACT,eAAe,EAEf,gBAAgB,EAEhB,cAAc,GACjB,MAAM,YAAY,CAAC;AA2CpB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAC9C,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAC9C,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AACrD,MAAM,qBAAqB,GAAG,6DAA6D,CAAC;AAC5F,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,iBAAiB,GAAwB,IAAI,GAAG,EAAE,CAAC;AACzD,MAAM,qBAAqB,GAAG,IAAI,CAAC,GAAG,EAAE,gCAAgC,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9F,MAAM,aAAa,GAAG,IAAI,CAA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IACjD,MAAM,SAAS,GAAmC,IAAI,GAAG,EAAE,CAAC;IAE5D,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,CAAC;QAC/B,qBAAqB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,qBAAqB,CAAC,MAA8B;IACzD,OAAO;QACH,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC;QACjC,SAAS,EAAE,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC;KACxD,CAAC;AACN,CAAC;AAED,SAAS,kBAAkB,CAAC,UAAwC;IAChE,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACpD,EAAE,EAAE,KAAK,GAAG,iBAAiB;QAC7B,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC;KAC1B,CAAC,CAAC,CAAC;AACR,CAAC;AAED,OAAO,EACH,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GAIrB,CAAC","sourcesContent":["import type { ExternalObject, Handle, RegisterClassProperty } from \"@gtkx/native\";\nimport type { AnyClass } from \"@gtkx/utils\";\nimport { camelCase, kebabCase } from \"@gtkx/utils\";\nimport { bind } from \"./bind.js\";\nimport { biguint64T, stringT, structT, voidT } from \"./descriptors.js\";\nimport { LIB, PARAM_T, VALUE_T } from \"./library.js\";\nimport {\n getParamFlags,\n getParamValueType,\n isParamConstructOnly,\n isParamLaxlyValidated,\n isParamWritable,\n type ValueGuard,\n valueGuardFor,\n wasParamValueModified,\n} from \"./param-spec.js\";\nimport { getHandle, getInterfaceProperties, instanceClassName, type InterfaceProperty } from \"./registry.js\";\nimport { typeName } from \"./type.js\";\nimport {\n fromValue,\n newValueForType,\n type ValueNarrower,\n valueNarrowerFor,\n type ValueWriter,\n valueWriterFor,\n} from \"./value.js\";\n\ntype PropertyCheck = {\n name: string;\n propertyName: string;\n handle: ExternalObject<Handle>;\n flags: number;\n valueType: bigint;\n canHoldValue: ValueGuard;\n narrowValue: ValueNarrower;\n write?: ValueWriter;\n scratch?: ExternalObject<Handle>;\n};\n\ntype PropertyAccessor = PropertyCheck & {\n memberName: string;\n storage: symbol;\n hasGeneratedMember: boolean;\n isInterfaceProperty?: boolean;\n delegate?: InterfaceProperty;\n};\n\n/** A `GObject.ParamSpec` wrapper describing one property's name, type, flags and default. */\ntype PropertySpec = object;\n\ntype PropertyDispatch = {\n accessors: PropertyAccessor[];\n delegates: Map<string, InterfaceProperty>;\n};\n\ntype PropertyDispatchSource = {\n klass: AnyClass;\n properties: Record<string, PropertySpec>;\n adoptedTypes: bigint[];\n};\n\ntype ConstructProperty = {\n name: string;\n value: ExternalObject<Handle>;\n};\n\ntype NotifyingObject = { notify?: (propertyName: string) => void };\n\nconst FIRST_PROPERTY_ID = 1;\nconst GET_PROPERTY_VFUNC = \"vfuncGetProperty\";\nconst SET_PROPERTY_VFUNC = \"vfuncSetProperty\";\nconst READ_ONLY_REASON = \"the property is read-only\";\nconst CONSTRUCT_ONLY_REASON = \"the property can only be set when the object is constructed\";\nconst CLASS_T = structT(\"borrowed\");\nconst interfaceStorages: Map<string, symbol> = new Map();\nconst paramSpecDefaultValue = bind(LIB, \"g_param_spec_get_default_value\", [PARAM_T], VALUE_T);\nconst paramSpecName = bind(LIB, \"g_param_spec_get_name\", [PARAM_T], stringT(\"borrowed\"));\nconst typeClassRef = bind(LIB, \"g_type_class_ref\", [biguint64T], CLASS_T);\nconst typeClassUnref = bind(LIB, \"g_type_class_unref\", [CLASS_T], voidT);\nconst classFindProperty = bind(LIB, \"g_object_class_find_property\", [CLASS_T, stringT(\"borrowed\")], PARAM_T);\n\nconst getPropertyName = (pspec: PropertySpec): string => paramSpecName(getHandle(pspec)) as string;\nconst underscoreCase = (name: string): string => name.replaceAll(\"-\", \"_\");\nconst canonicalCase = (name: string): string => kebabCase(name).replaceAll(\"_\", \"-\");\nconst accessorNames = (name: string): string[] => [...new Set([name, underscoreCase(name), camelCase(name)])];\nconst typeLabel = (type: bigint): string => typeName(type) ?? String(type);\n\nconst defaultValueFor = (handle: ExternalObject<Handle>): ExternalObject<Handle> =>\n paramSpecDefaultValue(handle) as ExternalObject<Handle>;\n\nconst heldValue = (value: unknown): unknown => value ?? null;\n\nconst holdsReason = (check: PropertyCheck): string =>\n `the property holds values of type '${typeLabel(check.valueType)}'`;\n\nfunction checkFor(handle: ExternalObject<Handle>, name: string): PropertyCheck {\n const valueType = getParamValueType(handle);\n\n return {\n name,\n propertyName: paramSpecName(handle) as string,\n handle,\n flags: getParamFlags(handle),\n valueType,\n canHoldValue: valueGuardFor(valueType),\n narrowValue: valueNarrowerFor(valueType),\n };\n}\n\nfunction findPropertySpec(klass: ExternalObject<Handle>, name: string): ExternalObject<Handle> | null {\n const found = classFindProperty(klass, name) as ExternalObject<Handle> | null;\n\n return found ?? (classFindProperty(klass, canonicalCase(name)) as ExternalObject<Handle> | null);\n}\n\nfunction describeValue(value: unknown): string {\n if (typeof value === \"string\") {\n return JSON.stringify(value);\n }\n\n if (typeof value === \"object\" && value !== null) {\n return instanceClassName(value);\n }\n\n return String(value);\n}\n\nfunction propertyMessage(instance: object, check: PropertyCheck, tail: string): string {\n return `${instanceClassName(instance)}.${check.name}: ${tail}`;\n}\n\nfunction refusalTail(check: PropertyCheck, value: unknown, reason: string): string {\n return `cannot set property '${check.propertyName}' to ${describeValue(value)}; ${reason}`;\n}\n\nfunction serveTail(check: PropertyCheck, value: unknown): string {\n return `cannot serve property '${check.propertyName}' from ${describeValue(value)}; ${holdsReason(check)}`;\n}\n\nfunction assertValueFits(instance: object, check: PropertyCheck, value: unknown): void {\n if (check.canHoldValue(value)) {\n return;\n }\n\n const tail = refusalTail(check, value, holdsReason(check));\n throw new TypeError(propertyMessage(instance, check, tail));\n}\n\nfunction assertValueServes(instance: object, check: PropertyCheck, value: unknown): void {\n if (check.canHoldValue(value)) {\n return;\n }\n\n throw new TypeError(propertyMessage(instance, check, serveTail(check, value)));\n}\n\nfunction assertValueValidates(\n instance: object,\n check: PropertyCheck,\n value: unknown,\n gValue: ExternalObject<Handle>,\n): void {\n if (!wasParamValueModified(check.handle, gValue) || isParamLaxlyValidated(check.flags)) {\n return;\n }\n\n const reason =\n `the value is invalid or out of range for type '${typeLabel(check.valueType)}', ` +\n `and GObject would put ${describeValue(fromValue(gValue))} in its place`;\n\n throw new RangeError(propertyMessage(instance, check, refusalTail(check, value, reason)));\n}\n\nfunction assertWritable(instance: object, check: PropertyCheck, value: unknown): void {\n if (isParamWritable(check.flags)) {\n return;\n }\n\n throw new TypeError(propertyMessage(instance, check, refusalTail(check, value, READ_ONLY_REASON)));\n}\n\nfunction writeHeld(check: PropertyCheck, gValue: ExternalObject<Handle>, value: unknown): void {\n check.write ??= valueWriterFor(check.valueType);\n check.write(gValue, check.narrowValue(value));\n}\n\nfunction fillCheckedValue(\n instance: object,\n check: PropertyCheck,\n gValue: ExternalObject<Handle>,\n value: unknown,\n): void {\n assertValueFits(instance, check, value);\n writeHeld(check, gValue, value);\n assertValueValidates(instance, check, value, gValue);\n}\n\nfunction checkedValueFor(instance: object, check: PropertyCheck, value: unknown): ExternalObject<Handle> {\n const gValue = newValueForType(check.valueType);\n fillCheckedValue(instance, check, gValue, value);\n\n return gValue;\n}\n\nfunction assertValueAccepted(instance: object, check: PropertyCheck, value: unknown): void {\n check.scratch ??= newValueForType(check.valueType);\n fillCheckedValue(instance, check, check.scratch, value);\n}\n\nfunction constructValueFor(wrapper: object, check: PropertyCheck, value: unknown): ConstructProperty {\n assertWritable(wrapper, check, value);\n\n return { name: check.propertyName, value: checkedValueFor(wrapper, check, value) };\n}\n\nfunction constructPropertyFor(\n gtype: bigint,\n name: string,\n value: unknown,\n wrapper: object,\n): ConstructProperty | undefined {\n const klass = typeClassRef(gtype) as ExternalObject<Handle>;\n\n try {\n const pspec = findPropertySpec(klass, name);\n\n return pspec === null ? undefined : constructValueFor(wrapper, checkFor(pspec, name), value);\n } finally {\n typeClassUnref(klass);\n }\n}\n\nfunction readStored(instance: Record<symbol, unknown>, accessor: PropertyAccessor): unknown {\n if (!Object.hasOwn(instance, accessor.storage)) {\n instance[accessor.storage] = fromValue(defaultValueFor(accessor.handle));\n }\n\n return instance[accessor.storage];\n}\n\nfunction storeValue(instance: Record<symbol, unknown>, accessor: PropertyAccessor, value: unknown): void {\n instance[accessor.storage] = heldValue(value);\n}\n\nfunction writeStored(instance: Record<symbol, unknown>, accessor: PropertyAccessor, value: unknown): void {\n if (readStored(instance, accessor) === heldValue(value)) {\n return;\n }\n\n storeValue(instance, accessor, value);\n (instance as NotifyingObject).notify?.(accessor.propertyName);\n}\n\nfunction writeProperty(instance: object, accessor: PropertyAccessor, value: unknown): void {\n const stored = instance as Record<symbol, unknown>;\n\n if (readStored(stored, accessor) === heldValue(value)) {\n return;\n }\n\n assertValueAccepted(instance, accessor, value);\n writeStored(stored, accessor, accessor.narrowValue(value));\n}\n\nfunction storedGetter(accessor: PropertyAccessor): (this: object) => unknown {\n return function get(this: object) {\n return readStored(this as Record<symbol, unknown>, accessor);\n };\n}\n\nfunction memberGetter(accessor: PropertyAccessor): (this: object) => unknown {\n return function get(this: object) {\n return (this as Record<string, unknown>)[accessor.memberName];\n };\n}\n\nfunction memberSetter(accessor: PropertyAccessor): (this: object, value: unknown) => void {\n return function set(this: object, value: unknown) {\n (this as Record<string, unknown>)[accessor.memberName] = value;\n };\n}\n\nfunction refusalFor(accessor: PropertyAccessor, reason: string): (this: object, value: unknown) => void {\n return function set(this: object, value: unknown) {\n throw new TypeError(propertyMessage(this, accessor, refusalTail(accessor, value, reason)));\n };\n}\n\nfunction checkedSetter(accessor: PropertyAccessor): (this: object, value: unknown) => void {\n if (!isParamWritable(accessor.flags)) {\n return refusalFor(accessor, READ_ONLY_REASON);\n }\n\n if (isParamConstructOnly(accessor.flags)) {\n return refusalFor(accessor, CONSTRUCT_ONLY_REASON);\n }\n\n return function set(this: object, value: unknown) {\n writeProperty(this, accessor, value);\n };\n}\n\nfunction hasOwnMember(prototype: object, alias: string): boolean {\n return Object.getOwnPropertyDescriptor(prototype, alias) !== undefined;\n}\n\nfunction defineAccessor(prototype: object, descriptor: PropertyDescriptor, alias: string): void {\n if (hasOwnMember(prototype, alias)) {\n return;\n }\n\n Object.defineProperty(prototype, alias, descriptor);\n}\n\nfunction installAccessors(klass: AnyClass, accessor: PropertyAccessor): void {\n const prototype = (klass as { prototype: object }).prototype;\n accessor.hasGeneratedMember = !hasOwnMember(prototype, accessor.memberName);\n\n const descriptor: PropertyDescriptor = {\n configurable: true,\n enumerable: true,\n get: accessor.hasGeneratedMember ? storedGetter(accessor) : memberGetter(accessor),\n set: accessor.hasGeneratedMember ? checkedSetter(accessor) : memberSetter(accessor),\n };\n\n for (const alias of accessorNames(accessor.name)) {\n defineAccessor(prototype, descriptor, alias);\n }\n}\n\nfunction storageFor(propertyName: string): symbol {\n const existing = interfaceStorages.get(propertyName);\n\n if (existing !== undefined) {\n return existing;\n }\n\n const created = Symbol(`gtkx:property:${propertyName}`);\n interfaceStorages.set(propertyName, created);\n\n return created;\n}\n\nfunction interfaceAccessorFor(dispatch: PropertyDispatch, pspec: PropertySpec): PropertyAccessor {\n const handle = getHandle(pspec);\n const propertyName = paramSpecName(handle) as string;\n const delegate = dispatch.delegates.get(propertyName);\n\n const accessor: PropertyAccessor = {\n ...checkFor(handle, propertyName),\n memberName: camelCase(propertyName),\n storage: storageFor(propertyName),\n hasGeneratedMember: false,\n isInterfaceProperty: true,\n };\n\n if (delegate !== undefined) {\n accessor.delegate = delegate;\n }\n\n return accessor;\n}\n\nfunction resolveAccessor(\n dispatch: PropertyDispatch,\n propertyId: number,\n pspec: PropertySpec,\n): PropertyAccessor {\n const accessor = dispatch.accessors[propertyId - FIRST_PROPERTY_ID];\n\n if (accessor !== undefined) {\n return accessor;\n }\n\n const created = interfaceAccessorFor(dispatch, pspec);\n dispatch.accessors[propertyId - FIRST_PROPERTY_ID] = created;\n\n return created;\n}\n\nfunction callMember(instance: object, member: string, args: unknown[]): unknown {\n const fn: unknown = (instance as Record<string, unknown>)[member];\n\n if (typeof fn !== \"function\") {\n throw new TypeError(`registerClass: ${instanceClassName(instance)} has no '${member}' member`);\n }\n\n return (fn as (...values: unknown[]) => unknown).apply(instance, args);\n}\n\nfunction backingMemberFor(instance: object, accessor: PropertyAccessor): string | undefined {\n if (accessor.hasGeneratedMember && !Object.hasOwn(instance, accessor.memberName)) {\n return undefined;\n }\n\n return accessor.memberName;\n}\n\nfunction readCurrent(instance: object, accessor: PropertyAccessor): unknown {\n const getter = accessor.delegate?.getter;\n\n if (getter !== undefined) {\n return callMember(instance, getter, []);\n }\n\n if (accessor.isInterfaceProperty === true) {\n return readStored(instance as Record<symbol, unknown>, accessor);\n }\n\n const member = backingMemberFor(instance, accessor);\n\n return member === undefined\n ? readStored(instance as Record<symbol, unknown>, accessor)\n : (instance as Record<string, unknown>)[member];\n}\n\nfunction writeCurrent(instance: object, accessor: PropertyAccessor, value: unknown): void {\n const setter = accessor.delegate?.setter;\n\n if (setter !== undefined) {\n callMember(instance, setter, [value]);\n\n return;\n }\n\n if (accessor.isInterfaceProperty === true) {\n writeStored(instance as Record<symbol, unknown>, accessor, value);\n\n return;\n }\n\n const member = backingMemberFor(instance, accessor);\n\n if (member === undefined) {\n storeValue(instance as Record<symbol, unknown>, accessor, value);\n\n return;\n }\n\n (instance as Record<string, unknown>)[member] = value;\n}\n\nfunction makeGetProperty(dispatch: PropertyDispatch) {\n return function getProperty(this: object, propertyId: number, value: object, pspec: PropertySpec): void {\n const accessor = resolveAccessor(dispatch, propertyId, pspec);\n const current = readCurrent(this, accessor);\n assertValueServes(this, accessor, current);\n writeHeld(accessor, getHandle(value), current);\n };\n}\n\nfunction makeSetProperty(dispatch: PropertyDispatch) {\n return function setProperty(this: object, propertyId: number, value: object, pspec: PropertySpec): void {\n const accessor = resolveAccessor(dispatch, propertyId, pspec);\n writeCurrent(this, accessor, fromValue(getHandle(value)));\n };\n}\n\nfunction assertCanonicalName(klass: AnyClass, name: string, propertyName: string): void {\n const canonical = canonicalCase(name);\n\n if (propertyName === canonical) {\n return;\n }\n\n throw new TypeError(\n `registerClass: ${klass.name} keys the property '${name}' to a GObject.ParamSpec named ` +\n `'${propertyName}', which is the name GObject notifies under; name the ParamSpec '${canonical}'`,\n );\n}\n\nfunction assertCanonicalNames(klass: AnyClass, properties: Record<string, PropertySpec>): void {\n for (const [name, pspec] of Object.entries(properties)) {\n assertCanonicalName(klass, name, getPropertyName(pspec));\n }\n}\n\nfunction buildAccessor(klass: AnyClass, name: string, pspec: PropertySpec): PropertyAccessor {\n const accessor: PropertyAccessor = {\n ...checkFor(getHandle(pspec), name),\n memberName: camelCase(name),\n storage: Symbol(`gtkx:property:${name}`),\n hasGeneratedMember: false,\n };\n\n installAccessors(klass, accessor);\n\n return accessor;\n}\n\nfunction buildAccessors(source: PropertyDispatchSource): PropertyAccessor[] {\n const { klass, properties } = source;\n assertCanonicalNames(klass, properties);\n\n return Object.entries(properties).map(([name, pspec]) => buildAccessor(klass, name, pspec));\n}\n\nfunction addInterfaceDelegates(delegates: Map<string, InterfaceProperty>, gtype: bigint): void {\n const properties = getInterfaceProperties(gtype) ?? {};\n\n for (const [name, delegate] of Object.entries(properties)) {\n if (!delegates.has(name)) {\n delegates.set(name, delegate);\n }\n }\n}\n\nfunction interfaceDelegatesFor(adoptedTypes: bigint[]): Map<string, InterfaceProperty> {\n const delegates: Map<string, InterfaceProperty> = new Map();\n\n for (const gtype of adoptedTypes) {\n addInterfaceDelegates(delegates, gtype);\n }\n\n return delegates;\n}\n\nfunction buildPropertyDispatch(source: PropertyDispatchSource): PropertyDispatch {\n return {\n accessors: buildAccessors(source),\n delegates: interfaceDelegatesFor(source.adoptedTypes),\n };\n}\n\nfunction toNativeProperties(properties: Record<string, PropertySpec>): RegisterClassProperty[] {\n return Object.values(properties).map((pspec, index) => ({\n id: index + FIRST_PROPERTY_ID,\n pspec: getHandle(pspec),\n }));\n}\n\nexport {\n buildPropertyDispatch,\n constructPropertyFor,\n GET_PROPERTY_VFUNC,\n makeGetProperty,\n makeSetProperty,\n SET_PROPERTY_VFUNC,\n toNativeProperties,\n type ConstructProperty,\n type PropertyDispatch,\n type PropertySpec,\n};\n"]}
1
+ {"version":3,"file":"properties.js","sourceRoot":"","sources":["../src/properties.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjH,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACH,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,eAAe,EACf,eAAe,EAEf,aAAa,EACb,qBAAqB,EACrB,mBAAmB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACH,YAAY,EACZ,SAAS,EACT,eAAe,EACf,sBAAsB,EACtB,iBAAiB,GAEpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1G,OAAO,EACH,SAAS,EACT,eAAe,EACf,qBAAqB,EAErB,gBAAgB,EAEhB,cAAc,GACjB,MAAM,YAAY,CAAC;AAgDpB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAC9C,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AA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pB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,GAIrB,CAAC","sourcesContent":["import type { ExternalObject, Handle, RegisterClassProperty } from \"@gtkx/native\";\nimport type { AnyClass } from \"@gtkx/utils\";\nimport { camelCase, kebabCase, toCamelIdentifier } from \"@gtkx/utils\";\nimport { bind } from \"./bind.js\";\nimport { biguint64T, fundamentalT, refT, sizedArrayT, stringT, structT, uint32T, voidT } from \"./descriptors.js\";\nimport { LIB, PARAM_T, VALUE_T } from \"./library.js\";\nimport {\n getParamFlags,\n getParamValueType,\n isParamConstructOnly,\n isParamExplicitlyNotified,\n isParamLaxlyValidated,\n isParamReadable,\n isParamWritable,\n type ValueGuard,\n valueGuardFor,\n wasParamValueModified,\n WHOLE_NUMBER_RANGES,\n} from \"./param-spec.js\";\nimport {\n getClassType,\n getHandle,\n getInstanceType,\n getInterfaceProperties,\n instanceClassName,\n type InterfaceProperty,\n} from \"./registry.js\";\nimport { TYPE_INTERFACE, TYPE_INVALID, TYPE_OBJECT, typeFundamental, typeIsA, typeName } from \"./type.js\";\nimport {\n fromValue,\n newValueForType,\n valueGuardOverrideFor,\n type ValueNarrower,\n valueNarrowerFor,\n type ValueWriter,\n valueWriterFor,\n} from \"./value.js\";\n\ntype PropertyCheck = {\n name: string;\n propertyName: string;\n handle: ExternalObject<Handle>;\n flags: number;\n valueType: bigint;\n canHoldValue: ValueGuard;\n narrowValue: ValueNarrower;\n write?: ValueWriter;\n scratch?: ExternalObject<Handle>;\n};\n\ntype AccessorBase = PropertyCheck & {\n storage: symbol;\n delegate?: InterfaceProperty;\n};\n\ntype DeclaredAccessor = AccessorBase & {\n isInterfaceProperty?: false;\n memberName: string;\n hasGeneratedMember: boolean;\n};\n\ntype InterfaceAccessor = AccessorBase & { isInterfaceProperty: true };\ntype PropertyAccessor = DeclaredAccessor | InterfaceAccessor;\n/** A `GObject.ParamSpec` wrapper describing one property's name, type, flags and default. */\ntype PropertySpec = object;\n\ntype PropertyDispatch = {\n accessors: PropertyAccessor[];\n delegates: Map<string, InterfaceProperty>;\n};\n\ntype PropertyDispatchSource = {\n klass: AnyClass;\n properties: Record<string, PropertySpec>;\n adoptedTypes: bigint[];\n};\n\ntype ConstructProperty = {\n name: string;\n value: ExternalObject<Handle>;\n};\n\ntype NotifyingObject = { notify?: (propertyName: string) => void };\n\nconst FIRST_PROPERTY_ID = 1;\nconst GET_PROPERTY_VFUNC = \"vfuncGetProperty\";\nconst SET_PROPERTY_VFUNC = \"vfuncSetProperty\";\nconst READ_ONLY_REASON = \"the property is read-only\";\nconst CONSTRUCT_ONLY_REASON = \"the property can only be set when the object is constructed\";\nconst CLASS_T = structT(\"borrowed\");\nconst CANONICAL_NAME_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\nconst DECLARED_NAMES = Symbol(\"gtkx:declaredPropertyNames\");\n\nconst OVERRIDE_PARAM_T = fundamentalT(LIB, \"g_param_spec_ref_sink\", \"g_param_spec_unref\", {\n ownership: \"borrowed\",\n typeName: \"GParam\",\n});\n\nconst interfaceStorages: Map<string, symbol> = new Map();\nconst paramSpecDefaultValue = bind(LIB, \"g_param_spec_get_default_value\", [PARAM_T], VALUE_T);\nconst paramSpecName = bind(LIB, \"g_param_spec_get_name\", [PARAM_T], stringT(\"borrowed\"));\nconst typeClassRef = bind(LIB, \"g_type_class_ref\", [biguint64T], CLASS_T);\nconst typeClassUnref = bind(LIB, \"g_type_class_unref\", [CLASS_T], voidT);\nconst coercionChecks: Map<bigint, Map<string, PropertyCheck | null>> = new Map();\nconst classFindProperty = bind(LIB, \"g_object_class_find_property\", [CLASS_T, stringT(\"borrowed\")], PARAM_T);\n\nconst classListProperties = bind(\n LIB,\n \"g_object_class_list_properties\",\n [CLASS_T, refT(uint32T)],\n sizedArrayT(PARAM_T, 1, \"full\"),\n);\n\nconst defaultInterfaceRef = bind(LIB, \"g_type_default_interface_ref\", [biguint64T], CLASS_T);\nconst defaultInterfaceUnref = bind(LIB, \"g_type_default_interface_unref\", [CLASS_T], voidT);\nconst interfaceFindProperty = bind(LIB, \"g_object_interface_find_property\", [CLASS_T, stringT(\"borrowed\")], PARAM_T);\nconst paramSpecOverrideNew = bind(LIB, \"g_param_spec_override\", [stringT(\"borrowed\"), PARAM_T], OVERRIDE_PARAM_T);\n\nconst getPropertyName = (pspec: PropertySpec): string => paramSpecName(getHandle(pspec)) as string;\nconst underscoreCase = (name: string): string => name.replaceAll(\"-\", \"_\");\nconst canonicalCase = (name: string): string => kebabCase(name).replaceAll(\"_\", \"-\");\nconst accessorNames = (name: string): string[] => [...new Set([name, underscoreCase(name), camelCase(name)])];\nconst typeLabel = (type: bigint): string => typeName(type) ?? String(type);\n\nconst defaultValueFor = (handle: ExternalObject<Handle>): ExternalObject<Handle> =>\n paramSpecDefaultValue(handle) as ExternalObject<Handle>;\n\nconst heldValue = (value: unknown): unknown => value ?? null;\n\nconst holdsReason = (check: PropertyCheck): string =>\n `the property holds values of type '${typeLabel(check.valueType)}'`;\n\nfunction checkFor(handle: ExternalObject<Handle>, name: string): PropertyCheck {\n const valueType = getParamValueType(handle);\n\n return {\n name,\n propertyName: paramSpecName(handle) as string,\n handle,\n flags: getParamFlags(handle),\n valueType,\n canHoldValue: valueGuardOverrideFor(valueType) ?? valueGuardFor(valueType),\n narrowValue: valueNarrowerFor(valueType),\n };\n}\n\nfunction accessorSpecs(klass: ExternalObject<Handle>): Map<string, ExternalObject<Handle>> {\n const specs: Map<string, ExternalObject<Handle>> = new Map();\n const countRef = { value: 0 };\n\n for (const pspec of classListProperties(klass, countRef) as ExternalObject<Handle>[]) {\n specs.set(toCamelIdentifier(paramSpecName(pspec) as string), pspec);\n }\n\n return specs;\n}\n\nfunction findPropertySpec(klass: ExternalObject<Handle>, name: string): ExternalObject<Handle> | null {\n const found = (classFindProperty(klass, name) ??\n classFindProperty(klass, canonicalCase(name))) as ExternalObject<Handle> | null;\n\n return found ?? accessorSpecs(klass).get(toCamelIdentifier(name)) ?? null;\n}\n\nconst sourceLabel = (source: bigint | AnyClass, gtype: bigint): string =>\n typeName(gtype) ?? (typeof source === \"function\" ? source.name : String(source));\n\nconst findInterfaceSpec = (gtype: bigint, name: string): ExternalObject<Handle> | null => {\n const vtable = defaultInterfaceRef(gtype) as ExternalObject<Handle>;\n\n try {\n return interfaceFindProperty(vtable, name) as ExternalObject<Handle> | null;\n } finally {\n defaultInterfaceUnref(vtable);\n }\n};\n\nconst findClassSpec = (gtype: bigint, name: string): ExternalObject<Handle> | null => {\n const klass = typeClassRef(gtype) as ExternalObject<Handle>;\n\n try {\n return classFindProperty(klass, name) as ExternalObject<Handle> | null;\n } finally {\n typeClassUnref(klass);\n }\n};\n\nconst findSourceSpec = (source: bigint | AnyClass, name: string): ExternalObject<Handle> => {\n const gtype = typeof source === \"bigint\" ? source : getClassType(source);\n const isInterface = typeIsA(gtype, TYPE_INTERFACE);\n\n if (!isInterface && !typeIsA(gtype, TYPE_OBJECT)) {\n throw new TypeError(\n `paramSpecOverride: '${sourceLabel(source, gtype)}' is neither a registered object class nor an interface`,\n );\n }\n\n const pspec = isInterface ? findInterfaceSpec(gtype, name) : findClassSpec(gtype, name);\n\n if (pspec === null) {\n throw new TypeError(`paramSpecOverride: type '${sourceLabel(source, gtype)}' has no property named '${name}'`);\n }\n\n return pspec;\n};\n\n/**\n * Creates the handle of a `GParamSpec` that redirects to the property `source` declares under\n * `name` — the equivalent of `g_param_spec_override`, which introspection does not expose.\n *\n * Throws when `source` is neither a GType nor a registered class or interface, and when it\n * declares no property under `name`.\n *\n * @param name Canonical name of the property to override.\n * @param source The GType, wrapper class or interface declaring the property.\n * @returns Handle of the override spec.\n */\nconst newParamSpecOverride = (name: string, source: bigint | AnyClass): ExternalObject<Handle> =>\n paramSpecOverrideNew(name, findSourceSpec(source, name)) as ExternalObject<Handle>;\n\nfunction describeValue(value: unknown): string {\n if (typeof value === \"string\") {\n return JSON.stringify(value);\n }\n\n if (typeof value === \"object\" && value !== null) {\n return instanceClassName(value);\n }\n\n return String(value);\n}\n\nfunction propertyMessage(instance: object, check: PropertyCheck, tail: string): string {\n return `${instanceClassName(instance)}.${check.name}: ${tail}`;\n}\n\nfunction refusalTail(check: PropertyCheck, value: unknown, reason: string): string {\n return `cannot set property '${check.propertyName}' to ${describeValue(value)}; ${reason}`;\n}\n\nfunction serveTail(check: PropertyCheck, value: unknown): string {\n return `cannot serve property '${check.propertyName}' from ${describeValue(value)}; ${holdsReason(check)}`;\n}\n\nfunction assertValueFits(instance: object, check: PropertyCheck, value: unknown): void {\n if (check.canHoldValue(value)) {\n return;\n }\n\n const tail = refusalTail(check, value, holdsReason(check));\n throw new TypeError(propertyMessage(instance, check, tail));\n}\n\nfunction assertValueServes(instance: object, check: PropertyCheck, value: unknown): void {\n if (check.canHoldValue(value)) {\n return;\n }\n\n throw new TypeError(propertyMessage(instance, check, serveTail(check, value)));\n}\n\nfunction assertValueValidates(\n instance: object,\n check: PropertyCheck,\n value: unknown,\n gValue: ExternalObject<Handle>,\n): void {\n if (!wasParamValueModified(check.handle, gValue) || isParamLaxlyValidated(check.flags)) {\n return;\n }\n\n const reason =\n `the value is invalid or out of range for type '${typeLabel(check.valueType)}', ` +\n `and GObject would put ${describeValue(fromValue(gValue))} in its place`;\n\n throw new RangeError(propertyMessage(instance, check, refusalTail(check, value, reason)));\n}\n\nfunction assertWritable(instance: object, check: PropertyCheck, value: unknown): void {\n if (isParamWritable(check.flags)) {\n return;\n }\n\n throw new TypeError(propertyMessage(instance, check, refusalTail(check, value, READ_ONLY_REASON)));\n}\n\nfunction writeHeld(check: PropertyCheck, gValue: ExternalObject<Handle>, value: unknown): void {\n check.write ??= valueWriterFor(check.valueType);\n check.write(gValue, check.narrowValue(value));\n}\n\nfunction fillCheckedValue(\n instance: object,\n check: PropertyCheck,\n gValue: ExternalObject<Handle>,\n value: unknown,\n): void {\n assertValueFits(instance, check, value);\n writeHeld(check, gValue, value);\n assertValueValidates(instance, check, value, gValue);\n}\n\nfunction checkedValueFor(instance: object, check: PropertyCheck, value: unknown): ExternalObject<Handle> {\n const gValue = newValueForType(check.valueType);\n fillCheckedValue(instance, check, gValue, value);\n\n return gValue;\n}\n\nfunction assertValueAccepted(instance: object, check: PropertyCheck, value: unknown): void {\n check.scratch ??= newValueForType(check.valueType);\n fillCheckedValue(instance, check, check.scratch, value);\n}\n\nfunction constructValueFor(wrapper: object, check: PropertyCheck, value: unknown): ConstructProperty {\n assertWritable(wrapper, check, value);\n\n return { name: check.propertyName, value: checkedValueFor(wrapper, check, value) };\n}\n\n/**\n * Whether the type declares a readable GObject property under `propertyName`, asking GObject itself\n * rather than looking for a generated accessor, which codegen omits when a method shares the name.\n */\nfunction isReadableProperty(gtype: bigint, propertyName: string): boolean {\n const klass = typeClassRef(gtype) as ExternalObject<Handle>;\n\n try {\n const pspec = findPropertySpec(klass, propertyName);\n\n return pspec !== null && isParamReadable(getParamFlags(pspec));\n } finally {\n typeClassUnref(klass);\n }\n}\n\nfunction lookupCoercionCheck(gtype: bigint, name: string): PropertyCheck | null {\n const klass = typeClassRef(gtype) as ExternalObject<Handle>;\n\n try {\n const pspec = findPropertySpec(klass, name);\n\n return pspec === null ? null : checkFor(pspec, name);\n } finally {\n typeClassUnref(klass);\n }\n}\n\nfunction coercionCheckFor(gtype: bigint, name: string): PropertyCheck | null {\n let checks = coercionChecks.get(gtype);\n\n if (checks === undefined) {\n checks = new Map();\n coercionChecks.set(gtype, checks);\n }\n\n let check = checks.get(name);\n\n if (check === undefined) {\n check = lookupCoercionCheck(gtype, name);\n checks.set(name, check);\n }\n\n return check;\n}\n\nfunction truncateToWhole(check: PropertyCheck, value: number): number {\n const range = WHOLE_NUMBER_RANGES.get(typeFundamental(check.valueType));\n\n if (range === undefined) {\n return value;\n }\n\n return Math.min(range[1], Math.max(range[0], Math.trunc(value)));\n}\n\nfunction validatedNumber(check: PropertyCheck, number: number): number {\n check.scratch ??= newValueForType(check.valueType);\n\n try {\n writeHeld(check, check.scratch, number);\n } catch {\n return number;\n }\n\n return wasParamValueModified(check.handle, check.scratch) ? (fromValue(check.scratch) as number) : number;\n}\n\nfunction coerceNumber(check: PropertyCheck, value: number): number {\n const number = truncateToWhole(check, value);\n\n return check.canHoldValue(number) ? validatedNumber(check, number) : value;\n}\n\nfunction coercePropertyValue(gtype: bigint, propertyName: string, value: unknown): unknown {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n return value;\n }\n\n const check = coercionCheckFor(gtype, propertyName);\n\n return check === null ? value : coerceNumber(check, value);\n}\n\n/**\n * Fits a number to what a GObject property accepts, the way an animation writing a value on every\n * frame needs: a fractional number headed for a property that holds whole numbers, such as a\n * `gint`, an enum, or flags, is truncated toward zero, and a number outside the range the\n * property's `GObject.ParamSpec` allows is clamped to it, so the write that follows never trips\n * GObject's range check. Anything that is not a finite number, a number the property cannot hold\n * at all, and a name the object installs no property under come back unchanged.\n *\n * @param obj The object the value is about to be written to.\n * @param propertyName The property name, dashed or camelCased.\n * @param value The value about to be written.\n * @returns The value as the property accepts it.\n */\nfunction coerceObjectProperty(obj: object, propertyName: string, value: unknown): unknown {\n if (typeof value !== \"number\") {\n return value;\n }\n\n const gtype = getInstanceType(obj);\n\n return gtype === TYPE_INVALID ? value : coercePropertyValue(gtype, propertyName, value);\n}\n\nfunction constructPropertyFor(\n gtype: bigint,\n name: string,\n value: unknown,\n wrapper: object,\n): ConstructProperty | undefined {\n const klass = typeClassRef(gtype) as ExternalObject<Handle>;\n\n try {\n const pspec = findPropertySpec(klass, name);\n\n return pspec === null ? undefined : constructValueFor(wrapper, checkFor(pspec, name), value);\n } finally {\n typeClassUnref(klass);\n }\n}\n\nfunction readStored(instance: Record<symbol, unknown>, accessor: PropertyAccessor): unknown {\n if (!Object.hasOwn(instance, accessor.storage)) {\n instance[accessor.storage] = fromValue(defaultValueFor(accessor.handle));\n }\n\n return instance[accessor.storage];\n}\n\nfunction storeValue(instance: Record<symbol, unknown>, accessor: PropertyAccessor, value: unknown): void {\n instance[accessor.storage] = heldValue(value);\n}\n\nfunction writeStored(instance: Record<symbol, unknown>, accessor: PropertyAccessor, value: unknown): void {\n if (readStored(instance, accessor) === heldValue(value)) {\n return;\n }\n\n storeValue(instance, accessor, value);\n (instance as NotifyingObject).notify?.(accessor.propertyName);\n}\n\nfunction writeProperty(instance: object, accessor: PropertyAccessor, value: unknown): void {\n const stored = instance as Record<symbol, unknown>;\n\n if (readStored(stored, accessor) === heldValue(value)) {\n return;\n }\n\n assertValueAccepted(instance, accessor, value);\n writeStored(stored, accessor, accessor.narrowValue(value));\n}\n\nfunction storedGetter(accessor: PropertyAccessor): (this: object) => unknown {\n return function get(this: object) {\n return readStored(this as Record<symbol, unknown>, accessor);\n };\n}\n\nfunction memberGetter(accessor: DeclaredAccessor): (this: object) => unknown {\n return function get(this: object) {\n return (this as Record<string, unknown>)[accessor.memberName];\n };\n}\n\nfunction memberSetter(accessor: DeclaredAccessor): (this: object, value: unknown) => void {\n return function set(this: object, value: unknown) {\n (this as Record<string, unknown>)[accessor.memberName] = value;\n };\n}\n\nfunction refusalFor(accessor: PropertyAccessor, reason: string): (this: object, value: unknown) => void {\n return function set(this: object, value: unknown) {\n throw new TypeError(propertyMessage(this, accessor, refusalTail(accessor, value, reason)));\n };\n}\n\nfunction checkedSetter(accessor: DeclaredAccessor): (this: object, value: unknown) => void {\n if (!isParamWritable(accessor.flags)) {\n return refusalFor(accessor, READ_ONLY_REASON);\n }\n\n if (isParamConstructOnly(accessor.flags)) {\n return refusalFor(accessor, CONSTRUCT_ONLY_REASON);\n }\n\n return function set(this: object, value: unknown) {\n writeProperty(this, accessor, value);\n };\n}\n\nfunction hasOwnMember(prototype: object, alias: string): boolean {\n return Object.getOwnPropertyDescriptor(prototype, alias) !== undefined;\n}\n\nfunction defineAccessor(prototype: object, descriptor: PropertyDescriptor, alias: string): void {\n if (hasOwnMember(prototype, alias)) {\n return;\n }\n\n Object.defineProperty(prototype, alias, descriptor);\n}\n\nfunction installAccessors(klass: AnyClass, accessor: DeclaredAccessor): void {\n const prototype = (klass as { prototype: object }).prototype;\n accessor.hasGeneratedMember = !hasOwnMember(prototype, accessor.memberName);\n\n const descriptor: PropertyDescriptor = {\n configurable: true,\n enumerable: true,\n get: accessor.hasGeneratedMember ? storedGetter(accessor) : memberGetter(accessor),\n set: accessor.hasGeneratedMember ? checkedSetter(accessor) : memberSetter(accessor),\n };\n\n for (const alias of accessorNames(accessor.name)) {\n defineAccessor(prototype, descriptor, alias);\n }\n}\n\nfunction storageFor(propertyName: string): symbol {\n const existing = interfaceStorages.get(propertyName);\n\n if (existing !== undefined) {\n return existing;\n }\n\n const created = Symbol(`gtkx:property:${propertyName}`);\n interfaceStorages.set(propertyName, created);\n\n return created;\n}\n\nfunction interfaceAccessorFor(dispatch: PropertyDispatch, pspec: PropertySpec): InterfaceAccessor {\n const handle = getHandle(pspec);\n const propertyName = paramSpecName(handle) as string;\n const delegate = dispatch.delegates.get(propertyName);\n\n const accessor: InterfaceAccessor = {\n ...checkFor(handle, propertyName),\n storage: storageFor(propertyName),\n isInterfaceProperty: true,\n };\n\n if (delegate !== undefined) {\n accessor.delegate = delegate;\n }\n\n return accessor;\n}\n\nfunction resolveAccessor(\n dispatch: PropertyDispatch,\n propertyId: number,\n pspec: PropertySpec,\n): PropertyAccessor {\n const accessor = dispatch.accessors[propertyId - FIRST_PROPERTY_ID];\n\n if (accessor !== undefined) {\n return accessor;\n }\n\n const created = interfaceAccessorFor(dispatch, pspec);\n dispatch.accessors[propertyId - FIRST_PROPERTY_ID] = created;\n\n return created;\n}\n\nfunction callMember(instance: object, member: string, args: unknown[]): unknown {\n const fn: unknown = (instance as Record<string, unknown>)[member];\n\n if (typeof fn !== \"function\") {\n throw new TypeError(`registerClass: ${instanceClassName(instance)} has no '${member}' member`);\n }\n\n return (fn as (...values: unknown[]) => unknown).apply(instance, args);\n}\n\nfunction backingMemberFor(instance: object, accessor: DeclaredAccessor): string | undefined {\n if (accessor.hasGeneratedMember && !Object.hasOwn(instance, accessor.memberName)) {\n return undefined;\n }\n\n return accessor.memberName;\n}\n\nfunction readCurrent(instance: object, accessor: PropertyAccessor): unknown {\n const getter = accessor.delegate?.getter;\n\n if (getter !== undefined) {\n return callMember(instance, getter, []);\n }\n\n if (accessor.isInterfaceProperty === true) {\n return readStored(instance as Record<symbol, unknown>, accessor);\n }\n\n const member = backingMemberFor(instance, accessor);\n\n return member === undefined\n ? readStored(instance as Record<symbol, unknown>, accessor)\n : (instance as Record<string, unknown>)[member];\n}\n\nfunction storeCurrent(instance: Record<symbol, unknown>, accessor: PropertyAccessor, value: unknown): void {\n if (isParamExplicitlyNotified(accessor.flags)) {\n writeStored(instance, accessor, value);\n } else {\n storeValue(instance, accessor, value);\n }\n}\n\nfunction writeCurrent(instance: object, accessor: PropertyAccessor, value: unknown): void {\n const setter = accessor.delegate?.setter;\n\n if (setter !== undefined) {\n callMember(instance, setter, [value]);\n\n return;\n }\n\n if (accessor.isInterfaceProperty === true) {\n writeStored(instance as Record<symbol, unknown>, accessor, value);\n\n return;\n }\n\n const member = backingMemberFor(instance, accessor);\n\n if (member === undefined) {\n storeCurrent(instance as Record<symbol, unknown>, accessor, value);\n\n return;\n }\n\n (instance as Record<string, unknown>)[member] = value;\n}\n\nfunction makeGetProperty(dispatch: PropertyDispatch) {\n return function getProperty(this: object, propertyId: number, value: object, pspec: PropertySpec): void {\n const accessor = resolveAccessor(dispatch, propertyId, pspec);\n const current = readCurrent(this, accessor);\n assertValueServes(this, accessor, current);\n writeHeld(accessor, getHandle(value), current);\n };\n}\n\nfunction makeSetProperty(dispatch: PropertyDispatch) {\n return function setProperty(this: object, propertyId: number, value: object, pspec: PropertySpec): void {\n const accessor = resolveAccessor(dispatch, propertyId, pspec);\n writeCurrent(this, accessor, fromValue(getHandle(value)));\n };\n}\n\nconst isCanonicalName = (name: string, propertyName: string): boolean =>\n CANONICAL_NAME_PATTERN.test(propertyName) && toCamelIdentifier(propertyName) === toCamelIdentifier(name);\n\nfunction assertCanonicalName(klass: AnyClass, name: string, propertyName: string): void {\n if (isCanonicalName(name, propertyName)) {\n return;\n }\n\n throw new TypeError(\n `registerClass: ${klass.name} keys the property '${name}' to a GObject.ParamSpec named ` +\n `'${propertyName}', which is the name GObject notifies under; name the ParamSpec '${canonicalCase(name)}'`,\n );\n}\n\nfunction assertCanonicalNames(klass: AnyClass, properties: Record<string, PropertySpec>): void {\n for (const [name, pspec] of Object.entries(properties)) {\n assertCanonicalName(klass, name, getPropertyName(pspec));\n }\n}\n\nfunction buildAccessor(klass: AnyClass, name: string, pspec: PropertySpec): DeclaredAccessor {\n const accessor: DeclaredAccessor = {\n ...checkFor(getHandle(pspec), name),\n memberName: camelCase(name),\n storage: Symbol(`gtkx:property:${name}`),\n hasGeneratedMember: false,\n };\n\n installAccessors(klass, accessor);\n\n return accessor;\n}\n\nfunction buildAccessors(source: PropertyDispatchSource): DeclaredAccessor[] {\n const { klass, properties } = source;\n assertCanonicalNames(klass, properties);\n\n return Object.entries(properties).map(([name, pspec]) => buildAccessor(klass, name, pspec));\n}\n\nfunction addInterfaceDelegates(delegates: Map<string, InterfaceProperty>, gtype: bigint): void {\n const properties = getInterfaceProperties(gtype) ?? {};\n\n for (const [name, delegate] of Object.entries(properties)) {\n if (!delegates.has(name)) {\n delegates.set(name, delegate);\n }\n }\n}\n\nfunction interfaceDelegatesFor(adoptedTypes: bigint[]): Map<string, InterfaceProperty> {\n const delegates: Map<string, InterfaceProperty> = new Map();\n\n for (const gtype of adoptedTypes) {\n addInterfaceDelegates(delegates, gtype);\n }\n\n return delegates;\n}\n\nfunction recordDeclaredNames(klass: AnyClass, accessors: DeclaredAccessor[]): void {\n const proto = klass.prototype as Record<PropertyKey, unknown>;\n const inherited = proto[DECLARED_NAMES] as Record<string, string> | undefined;\n const own: Record<string, string> = {};\n\n for (const accessor of accessors) {\n own[accessor.memberName] = accessor.propertyName;\n }\n\n Object.defineProperty(proto, DECLARED_NAMES, { value: { ...inherited, ...own }, enumerable: false });\n}\n\nfunction buildPropertyDispatch(source: PropertyDispatchSource): PropertyDispatch {\n const declared = buildAccessors(source);\n recordDeclaredNames(source.klass, declared);\n\n return { accessors: [...declared], delegates: interfaceDelegatesFor(source.adoptedTypes) };\n}\n\n/**\n * The GObject name a class registered with `registerClass` installed an accessor under, or\n * `undefined` when the accessor names no property the class declared itself.\n */\nfunction getDeclaredPropertyName(object: object, accessor: string): string | undefined {\n const declared = (object as Record<PropertyKey, unknown>)[DECLARED_NAMES] as\n | Record<string, string> |\n undefined;\n\n return declared?.[accessor];\n}\n\nfunction toNativeProperties(properties: Record<string, PropertySpec>): RegisterClassProperty[] {\n return Object.values(properties).map((pspec, index) => ({\n id: index + FIRST_PROPERTY_ID,\n pspec: getHandle(pspec),\n }));\n}\n\nexport {\n buildPropertyDispatch,\n coerceObjectProperty,\n getDeclaredPropertyName,\n isReadableProperty,\n coercePropertyValue,\n constructPropertyFor,\n GET_PROPERTY_VFUNC,\n makeGetProperty,\n makeSetProperty,\n newParamSpecOverride,\n SET_PROPERTY_VFUNC,\n toNativeProperties,\n type ConstructProperty,\n type PropertyDispatch,\n type PropertySpec,\n};\n"]}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Scans for a match of a compiled `GRegex` in the subject string, keeping the subject's bytes
3
+ * alive so the returned match info's fetch methods stay valid for as long as it is reachable.
4
+ *
5
+ * @param regex The compiled regex to scan with.
6
+ * @param subject The string to scan for matches.
7
+ * @param startPosition Starting index of the subject to match, in bytes.
8
+ * @param matchOptions Match options to apply.
9
+ * @returns Whether the subject matched, and the match info describing the match.
10
+ */
11
+ declare function matchRegex<MatchInfo extends object>(regex: object, subject: string | string[], startPosition: number, matchOptions: number): [boolean, MatchInfo];
12
+ /**
13
+ * Scans for all possible matches of a compiled `GRegex` in the subject string using the DFA
14
+ * algorithm, including overlapping matches, keeping the subject's bytes alive so the returned
15
+ * match info's fetch methods stay valid for as long as it is reachable.
16
+ *
17
+ * @param regex The compiled regex to scan with.
18
+ * @param subject The string to scan for matches.
19
+ * @param startPosition Starting index of the subject to match, in bytes.
20
+ * @param matchOptions Match options to apply.
21
+ * @returns Whether the subject matched, and the match info describing the matches.
22
+ */
23
+ declare function matchAllRegex<MatchInfo extends object>(regex: object, subject: string | string[], startPosition: number, matchOptions: number): [boolean, MatchInfo];
24
+ export { matchAllRegex, matchRegex };
25
+ //# sourceMappingURL=regex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../src/regex.ts"],"names":[],"mappings":"AAoDA;;;;;;;;;GASG;AACH,iBAAS,UAAU,CAAC,SAAS,SAAS,MAAM,EACxC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GACrB,CAAC,OAAO,EAAE,SAAS,CAAC,CAEtB;AAED;;;;;;;;;;GAUG;AACH,iBAAS,aAAa,CAAC,SAAS,SAAS,MAAM,EAC3C,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GACrB,CAAC,OAAO,EAAE,SAAS,CAAC,CAEtB;AAED,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"}
package/dist/regex.js ADDED
@@ -0,0 +1,59 @@
1
+ import {} from "./arg.js";
2
+ import { booleanT, boxedT, bufferT, int32T, int64T, uint32T } from "./descriptors.js";
3
+ import { fn } from "./fn.js";
4
+ import { LIB } from "./library.js";
5
+ import { getHandle } from "./registry.js";
6
+ const MATCH_ARGS = [
7
+ {
8
+ type: boxedT("GRegex", { ownership: "borrowed", sharedLibrary: LIB, getTypeFnName: "g_regex_get_type" }),
9
+ },
10
+ { type: bufferT },
11
+ { type: int64T },
12
+ { type: int32T },
13
+ { type: uint32T },
14
+ {
15
+ type: boxedT("GMatchInfo", { ownership: "full", sharedLibrary: LIB, getTypeFnName: "g_match_info_get_type" }),
16
+ direction: "out",
17
+ },
18
+ ];
19
+ const gRegexMatchFull = fn(LIB, "g_regex_match_full", { args: MATCH_ARGS, returns: booleanT, canThrow: true });
20
+ const gRegexMatchAllFull = fn(LIB, "g_regex_match_all_full", { args: MATCH_ARGS, returns: booleanT, canThrow: true });
21
+ /* eslint-disable-next-line sonarjs/no-unused-collection -- keeps each subject's bytes alive alongside its match info */
22
+ const subjectBytes = new WeakMap();
23
+ const encoder = new TextEncoder();
24
+ const flattenSubject = (subject) => Array.isArray(subject) ? subject.join("") : subject;
25
+ const matchWithSubject = (boundFn, { regex, subject, startPosition, matchOptions }) => {
26
+ const bytes = encoder.encode(`${flattenSubject(subject)}\0`);
27
+ const result = boundFn(getHandle(regex), bytes, bytes.length - 1, startPosition, matchOptions);
28
+ subjectBytes.set(result[1], bytes);
29
+ return result;
30
+ };
31
+ /**
32
+ * Scans for a match of a compiled `GRegex` in the subject string, keeping the subject's bytes
33
+ * alive so the returned match info's fetch methods stay valid for as long as it is reachable.
34
+ *
35
+ * @param regex The compiled regex to scan with.
36
+ * @param subject The string to scan for matches.
37
+ * @param startPosition Starting index of the subject to match, in bytes.
38
+ * @param matchOptions Match options to apply.
39
+ * @returns Whether the subject matched, and the match info describing the match.
40
+ */
41
+ function matchRegex(regex, subject, startPosition, matchOptions) {
42
+ return matchWithSubject(gRegexMatchFull, { regex, subject, startPosition, matchOptions });
43
+ }
44
+ /**
45
+ * Scans for all possible matches of a compiled `GRegex` in the subject string using the DFA
46
+ * algorithm, including overlapping matches, keeping the subject's bytes alive so the returned
47
+ * match info's fetch methods stay valid for as long as it is reachable.
48
+ *
49
+ * @param regex The compiled regex to scan with.
50
+ * @param subject The string to scan for matches.
51
+ * @param startPosition Starting index of the subject to match, in bytes.
52
+ * @param matchOptions Match options to apply.
53
+ * @returns Whether the subject matched, and the match info describing the matches.
54
+ */
55
+ function matchAllRegex(regex, subject, startPosition, matchOptions) {
56
+ return matchWithSubject(gRegexMatchAllFull, { regex, subject, startPosition, matchOptions });
57
+ }
58
+ export { matchAllRegex, matchRegex };
59
+ //# sourceMappingURL=regex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.js","sourceRoot":"","sources":["../src/regex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAS1C,MAAM,UAAU,GAAU;IACtB;QACI,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC;KAC3G;IACD,EAAE,IAAI,EAAE,OAAO,EAAE;IACjB,EAAE,IAAI,EAAE,MAAM,EAAE;IAChB,EAAE,IAAI,EAAE,MAAM,EAAE;IAChB,EAAE,IAAI,EAAE,OAAO,EAAE;IACjB;QACI,IAAI,EAAE,MAAM,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,uBAAuB,EAAE,CAAC;QAC7G,SAAS,EAAE,KAAK;KACnB;CACJ,CAAC;AAEF,MAAM,eAAe,GAAG,EAAE,CAAC,GAAG,EAAE,oBAAoB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/G,MAAM,kBAAkB,GAAG,EAAE,CAAC,GAAG,EAAE,wBAAwB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,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AAC","sourcesContent":["import { type Arg } from \"./arg.js\";\nimport { booleanT, boxedT, bufferT, int32T, int64T, uint32T } from \"./descriptors.js\";\nimport { fn } from \"./fn.js\";\nimport { LIB } from \"./library.js\";\nimport { getHandle } from \"./registry.js\";\n\ntype MatchParams = {\n regex: object;\n subject: string | string[];\n startPosition: number;\n matchOptions: number;\n};\n\nconst MATCH_ARGS: Arg[] = [\n {\n type: boxedT(\"GRegex\", { ownership: \"borrowed\", sharedLibrary: LIB, getTypeFnName: \"g_regex_get_type\" }),\n },\n { type: bufferT },\n { type: int64T },\n { type: int32T },\n { type: uint32T },\n {\n type: boxedT(\"GMatchInfo\", { ownership: \"full\", sharedLibrary: LIB, getTypeFnName: \"g_match_info_get_type\" }),\n direction: \"out\",\n },\n];\n\nconst gRegexMatchFull = fn(LIB, \"g_regex_match_full\", { args: MATCH_ARGS, returns: booleanT, canThrow: true });\nconst gRegexMatchAllFull = fn(LIB, \"g_regex_match_all_full\", { args: MATCH_ARGS, returns: booleanT, canThrow: true });\n/* eslint-disable-next-line sonarjs/no-unused-collection -- keeps each subject's bytes alive alongside its match info */\nconst subjectBytes: WeakMap<object, Uint8Array> = new WeakMap();\nconst encoder = new TextEncoder();\n\nconst flattenSubject = (subject: string | string[]): string =>\n Array.isArray(subject) ? subject.join(\"\") : subject;\n\nconst matchWithSubject = <MatchInfo extends object>(\n boundFn: (...inputs: unknown[]) => unknown,\n { regex, subject, startPosition, matchOptions }: MatchParams,\n): [boolean, MatchInfo] => {\n const bytes = encoder.encode(`${flattenSubject(subject)}\\0`);\n\n const result = boundFn(getHandle(regex), bytes, bytes.length - 1, startPosition, matchOptions) as [\n boolean,\n MatchInfo,\n ];\n\n subjectBytes.set(result[1], bytes);\n\n return result;\n};\n\n/**\n * Scans for a match of a compiled `GRegex` in the subject string, keeping the subject's bytes\n * alive so the returned match info's fetch methods stay valid for as long as it is reachable.\n *\n * @param regex The compiled regex to scan with.\n * @param subject The string to scan for matches.\n * @param startPosition Starting index of the subject to match, in bytes.\n * @param matchOptions Match options to apply.\n * @returns Whether the subject matched, and the match info describing the match.\n */\nfunction matchRegex<MatchInfo extends object>(\n regex: object,\n subject: string | string[],\n startPosition: number,\n matchOptions: number,\n): [boolean, MatchInfo] {\n return matchWithSubject(gRegexMatchFull, { regex, subject, startPosition, matchOptions });\n}\n\n/**\n * Scans for all possible matches of a compiled `GRegex` in the subject string using the DFA\n * algorithm, including overlapping matches, keeping the subject's bytes alive so the returned\n * match info's fetch methods stay valid for as long as it is reachable.\n *\n * @param regex The compiled regex to scan with.\n * @param subject The string to scan for matches.\n * @param startPosition Starting index of the subject to match, in bytes.\n * @param matchOptions Match options to apply.\n * @returns Whether the subject matched, and the match info describing the matches.\n */\nfunction matchAllRegex<MatchInfo extends object>(\n regex: object,\n subject: string | string[],\n startPosition: number,\n matchOptions: number,\n): [boolean, MatchInfo] {\n return matchWithSubject(gRegexMatchAllFull, { regex, subject, startPosition, matchOptions });\n}\n\nexport { matchAllRegex, matchRegex };\n"]}
@@ -1,5 +1,6 @@
1
1
  import { type AnyClass } from "@gtkx/utils";
2
2
  import { type PropertySpec } from "./properties.js";
3
+ import { type TypedClass } from "./type.js";
3
4
  /**
4
5
  * A generated interface value, such as `Gio.ListModel`, in the form {@link registerClass} takes it.
5
6
  * `__impl__` exists only in the type system: it carries the interface's `Impl` type, of which a class
@@ -31,13 +32,48 @@ type Camelized<TName extends string> = TName extends `${infer THead}-${infer TTa
31
32
  * type and names nothing, because a name only known as `string` addresses no member in particular.
32
33
  */
33
34
  type InstalledNames<TProperties> = string extends keyof TProperties ? never : Camelized<Dashed<keyof TProperties & string>>;
35
+ /**
36
+ * The base names the signal surface takes for the signals `RegisterClassOptions.signals` declares:
37
+ * each name as written, plus its canonical spelling with underscores turned into dashes, which
38
+ * GObject knows the signal by too.
39
+ */
40
+ type DeclaredSignalBase<TSignals> = (keyof TSignals & string) | Dashed<keyof TSignals & string>;
41
+ /**
42
+ * The names `connect` and `emit` take for one of the signals `RegisterClassOptions.signals`
43
+ * declares: each spelling of each name, plus its detailed form for a signal emitted with a
44
+ * `::detail` suffix.
45
+ */
46
+ type DeclaredSignalName<TSignals> = DeclaredSignalBase<TSignals> | `${DeclaredSignalBase<TSignals>}::${string}`;
47
+ /**
48
+ * The `connect` and `emit` signatures instances gain for the signals
49
+ * `RegisterClassOptions.signals` declares, widening the inherited ones, which take only the names
50
+ * introspection knows. A class declaring no signals gains nothing, since no name reaches the
51
+ * added signatures.
52
+ */
53
+ type DeclaredSignalMethods<TSignals> = {
54
+ /**
55
+ * Type-level map from declared signal name to handler signature, feeding the hooks that
56
+ * address a signal by name, such as `useSignal` from `@gtkx/react`; no value ever carries it.
57
+ */
58
+ __signals__?: Record<DeclaredSignalBase<TSignals>, (...args: never[]) => unknown>;
59
+ /** Connects a handler to a signal `RegisterClassOptions.signals` declared. */
60
+ connect(signal: DeclaredSignalName<TSignals>, handler: (...args: never[]) => unknown, isAfter?: boolean): number;
61
+ /** Emits a signal `RegisterClassOptions.signals` declared. */
62
+ emit(sigName: DeclaredSignalName<TSignals>, ...args: unknown[]): unknown;
63
+ /** Connects a handler to a signal `RegisterClassOptions.signals` declared, for `off` to take off. */
64
+ on(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;
65
+ /** Connects a handler to a signal `RegisterClassOptions.signals` declared for one emission. */
66
+ once(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;
67
+ /** Disconnects a handler `on` or `once` connected to a signal `RegisterClassOptions.signals` declared. */
68
+ off(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown): unknown;
69
+ };
34
70
  /**
35
71
  * An instance of a registered class: everything the class itself declares, plus the property map the
36
72
  * hooks that address a property by name, such as `useProperty` from `@gtkx/react`, read the installed
37
73
  * names off. Each name is typed with the value type the class declares for the member of that name,
38
74
  * so a property the class does not `declare` contributes nothing.
39
75
  */
40
- type RegisteredInstance<TInstance, TProperties> = TInstance & {
76
+ type RegisteredInstance<TInstance, TProperties, TSignals> = TInstance & DeclaredSignalMethods<TSignals> & {
41
77
  /** Type-level map from installed property name to value type; no value ever carries it. */
42
78
  __properties__: Pick<TInstance, InstalledNames<TProperties> & keyof TInstance>;
43
79
  };
@@ -50,16 +86,79 @@ type RegisteredConstructor<TClass, TArgs extends unknown[], TInstance> = {
50
86
  /** Object the class's instances inherit from. */
51
87
  prototype: TInstance;
52
88
  } & (TClass extends new (...args: never) => unknown ? new (...args: TArgs) => TInstance : abstract new (...args: TArgs) => TInstance);
89
+ /** The statics a registered class keeps from the class it was, joined with {@link RegisteredConstructor}. */
90
+ type RegisteredParts<TClass, TArgs extends unknown[], TInstance> = Omit<TClass, "prototype"> & RegisteredConstructor<TClass, TArgs, TInstance>;
53
91
  /**
54
92
  * The class {@link registerClass} hands back: the same class, with the same statics, whose instances
55
- * carry the properties `RegisterClassOptions.properties` installed. Binding the call to a name, rather
56
- * than discarding it, is what carries those names into the type system.
93
+ * carry the properties `RegisterClassOptions.properties` installed and take the signals
94
+ * `RegisterClassOptions.signals` declares by name. Binding the call to a name, rather than
95
+ * discarding it, is what carries those names into the type system.
96
+ */
97
+ type RegisteredClass<TClass extends AnyClass, TProperties, TSignals> = TClass extends abstract new (...args: infer TArgs) => infer TInstance ? RegisteredParts<TClass, TArgs, RegisteredInstance<TInstance, TProperties, TSignals>> : never;
98
+ /**
99
+ * A GType in the form `RegisterClassOptions.signals` takes one: the numeric GType itself, such as
100
+ * `TYPE_STRING` from `@gtkx/gi/gobject`, or a class carrying one, which is any generated wrapper
101
+ * class and any class an earlier {@link registerClass} call registered.
102
+ */
103
+ type SignalGType = bigint | AnyClass<TypedClass>;
104
+ /**
105
+ * One signal `RegisterClassOptions.signals` creates on the new type, sitting under the signal's
106
+ * name. Every part is optional: `{}` declares a signal with no arguments and no return value that
107
+ * runs its handlers in the default `RUN_FIRST` stage.
57
108
  */
58
- type RegisteredClass<TClass extends AnyClass, TProperties> = TClass extends abstract new (...args: infer TArgs) => infer TInstance ? Omit<TClass, "prototype"> & RegisteredConstructor<TClass, TArgs, RegisteredInstance<TInstance, TProperties>> : never;
109
+ type SignalSpec = {
110
+ /**
111
+ * `GObject.SignalFlags` bit mask for the signal, defaulting to `RUN_FIRST`. `DETAILED` lets
112
+ * handlers connect to and emissions name a `::detail` suffix.
113
+ */
114
+ flags?: number;
115
+ /** GType of each argument an emission carries, defaulting to none. */
116
+ paramTypes?: SignalGType[];
117
+ /** GType of the value an emission returns, defaulting to none. */
118
+ returnType?: SignalGType;
119
+ /**
120
+ * How the emission combines what its handlers return, limited to the two accumulators GObject
121
+ * ships: `"first-wins"` stops the emission at the first handler and keeps its result, and
122
+ * `"true-handled"` runs handlers until one returns `true`, which requires a boolean
123
+ * `returnType`. Without one, every handler runs and the last result stands.
124
+ */
125
+ accumulator?: "first-wins" | "true-handled";
126
+ };
59
127
  /** What {@link registerClass} adds to the new GType beyond the vtable slots it discovers on the class. */
60
- type RegisterClassOptions<TInstance extends object, TProperties extends Record<string, PropertySpec>> = {
61
- /** Name to register the new GType under, defaulting to the class's own name. */
128
+ type RegisterClassOptions<TInstance extends object, TProperties extends Record<string, PropertySpec>, TSignals extends Record<string, SignalSpec>> = {
129
+ /**
130
+ * Name to register the new GType under, defaulting to the class's own name. Either way the
131
+ * name has to be a valid GType name: at least three characters, starting with a letter or
132
+ * underscore, the rest letters, digits, `-`, `_` or `+`. Any other name throws a `TypeError`.
133
+ */
62
134
  typeName?: string;
135
+ /**
136
+ * Registers the new GType abstract, the way `G_TYPE_FLAG_ABSTRACT` marks a C type: the class
137
+ * still serves as a parent for further registered subclasses, which instantiate as usual, but
138
+ * constructing it directly throws, whether from JavaScript or from a native caller.
139
+ */
140
+ abstract?: boolean;
141
+ /**
142
+ * Name instances of the new type carry in CSS, applied through `gtk_widget_class_set_css_name`
143
+ * from inside the type's `class_init`, so every instance is born with it, wherever it is
144
+ * created from. Requires the class to extend `Gtk.Widget`; registering a non-widget with a
145
+ * `cssName` throws.
146
+ */
147
+ cssName?: string;
148
+ /**
149
+ * Hook run once, synchronously, while `registerClass` registers the type, after its
150
+ * `class_init` has installed the vfuncs, properties and signals declared here. It receives the
151
+ * new type's class struct wrapped in its generated GTypeStruct wrapper, so class-level setup
152
+ * calls such as `Gtk.WidgetClass.installAction`, `Gtk.WidgetClass.addShortcut` and
153
+ * `Gtk.WidgetClass.setLayoutManagerType` have somewhere to land. The wrapper serves the
154
+ * members of every struct in the parent chain on one object: a widget subclass sees
155
+ * `Gtk.WidgetClass` and `GObject.ObjectClass` members alike, so the parameter can be declared
156
+ * as whichever of those types the hook needs. The class struct belongs to the type system for
157
+ * the life of the process, so keeping the wrapper around past the hook is safe, if rarely
158
+ * useful. An exception the hook throws propagates out of `registerClass`, with the type
159
+ * already registered: GObject offers no way to unregister a static type.
160
+ */
161
+ classInit?(typeStruct: object): void;
63
162
  /**
64
163
  * Interfaces the new type implements on top of the ones it inherits, given as the interface values
65
164
  * themselves, such as `Gio.ListModel`. Their vtable slots are filled from the `vfunc`-prefixed methods on
@@ -71,10 +170,15 @@ type RegisterClassOptions<TInstance extends object, TProperties extends Record<s
71
170
  * Properties to install on the new type, keyed by the name JavaScript addresses each one by and
72
171
  * valued with the `GObject.ParamSpec` describing it. A key is read in camelCase however it is
73
172
  * written, so `dewPoint`, `dew_point` and `dew-point` all name the same member, and the ParamSpec
74
- * has to carry the canonical spelling of that name, `dew-point`, or registration throws: the
75
- * ParamSpec's name is the one GObject emits `notify` with, and a name the key does not spell
76
- * reaches nothing that listens for it. Every property gains prototype accessors, one for the key
77
- * as written, one for it with dashes turned into underscores and one for it in camelCase, each
173
+ * has to carry a name that reads back as that same member, such as `dew-point`, or registration
174
+ * throws: the ParamSpec's name is the one GObject emits `notify` with, and a name the key does
175
+ * not spell reaches nothing that listens for it. A word starting with a digit is a word of its
176
+ * own on either side of that reading, so `level2Depth` takes a ParamSpec named `level-2-depth`
177
+ * as readily as one named `level2-depth`, the way `WebKit.Settings` names
178
+ * `enable-2d-canvas-acceleration` for its `enable2dCanvasAcceleration` member. An uppercase
179
+ * letter in the ParamSpec's own name is refused, since GObject notifies under that spelling
180
+ * and nothing else reads it back. Every property gains prototype accessors, one for the key as
181
+ * written, one for it with dashes turned into underscores and one for it in camelCase, each
78
182
  * unless the class already defines that name. They serve the value from storage of their own on
79
183
  * the instance, which is also what the type's `get_property` and `set_property` slots read and
80
184
  * write, so a value set from JavaScript, from `g_object_set_property` and at construction all
@@ -123,6 +227,30 @@ type RegisterClassOptions<TInstance extends object, TProperties extends Record<s
123
227
  * and write it rather than the generated storage.
124
228
  */
125
229
  properties?: TProperties;
230
+ /**
231
+ * Signals to create on the new type, keyed by signal name and valued with the
232
+ * {@link SignalSpec} describing each one. A name has to start with a lowercase letter, continue
233
+ * in lowercase letters, digits, `-` and `_`, and be new to the type: one an ancestor type or a
234
+ * listed interface already carries throws, and so does one carrying an uppercase letter, which
235
+ * GObject would carry under that exact spelling, out of reach of both its dashed spelling and
236
+ * its `on<SignalName>` default handler. The two word separators spell the same signal, so a
237
+ * signal declared as `data_changed` is connected to and emitted as `data-changed` too.
238
+ *
239
+ * Instances connect and emit by name through the same `connect`, `on`, `once`, `off` and
240
+ * `emit` surface inherited signals use: `registerClass` wraps `connect` and `emit` on the
241
+ * class's prototype to serve the declared names, unless the class defines the member itself,
242
+ * and hands every other name to the inherited implementation. A handler receives the
243
+ * emission's arguments without the leading emitter, matching a generated signal, and what it
244
+ * returns becomes the emission's return value when the signal declares one.
245
+ *
246
+ * The declared parameter GTypes rule the emission: `emit` takes exactly one argument per
247
+ * declared parameter, throwing a `TypeError` for any other count, and converts each argument
248
+ * into a `GValue` of the declared type, throwing for a value that type cannot hold. The signals
249
+ * are created with no class closure of their own, but a method named `on<SignalName>`
250
+ * becomes the signal's default handler, the way every `on`-prefixed method that names a
251
+ * signal the type carries does; see {@link registerClass}.
252
+ */
253
+ signals?: TSignals;
126
254
  };
127
255
  /**
128
256
  * Registers a subclass of a wrapper class as a new GType, wiring up any class and interface
@@ -130,10 +258,19 @@ type RegisterClassOptions<TInstance extends object, TProperties extends Record<s
130
258
  * `RegisterClassOptions.implements` names.
131
259
  *
132
260
  * Throws when the class does not extend a registered wrapper class, when it has no derivable type
133
- * name, when an entry in `RegisterClassOptions.implements` is not a registered interface, when a
261
+ * name or the name is not a valid GType name, when an entry in
262
+ * `RegisterClassOptions.implements` is not a registered interface, when a
134
263
  * listed interface has a prerequisite that neither the parent type nor another listed interface meets,
135
- * and when an entry in `RegisterClassOptions.properties` names its `GObject.ParamSpec` something other
136
- * than the canonical spelling of the key it sits under.
264
+ * when the list names `Gio.AsyncInitable` as an interface the parent type does not already
265
+ * implement and no method on the chain fills `vfuncInitAsync`, since the default `init_async`
266
+ * would run `vfuncInit` on a worker thread, when an entry in
267
+ * `RegisterClassOptions.properties` names its `GObject.ParamSpec` something the key it sits under
268
+ * does not spell, when an entry in `RegisterClassOptions.signals` carries an invalid name, a name
269
+ * spelled with an uppercase letter rather than dashed, a name the type already knows, a GType
270
+ * that cannot hold a value, or an accumulator the spec does not admit, and when
271
+ * `RegisterClassOptions.cssName` is
272
+ * given for a class that does not extend `Gtk.Widget`. An exception thrown by
273
+ * `RegisterClassOptions.classInit` also propagates, after the type has already been registered.
137
274
  *
138
275
  * A slot is filled from the `vfunc`-prefixed methods on the class's prototype chain, up to but not
139
276
  * including the registered ancestor the class extends, so a method an intermediate base class
@@ -143,6 +280,19 @@ type RegisterClassOptions<TInstance extends object, TProperties extends Record<s
143
280
  * Declare every slot as a method: a class field holding a function, such as `vfuncGetNItems = () => 1`,
144
281
  * is assigned to each instance after registration and never reaches the vtable.
145
282
  *
283
+ * A method named `on<SignalName>` — the signal's name in camelCase after the `on`, so `onClicked`
284
+ * for `clicked` and `onItemsChanged` for `items-changed` — becomes that signal's default handler
285
+ * when the type carries the signal, whether an ancestor type or an implemented interface brings it
286
+ * or `RegisterClassOptions.signals` declares it. The method is installed as a class-closure
287
+ * override, so it runs on every emission, on the instances a native caller creates included, in
288
+ * the stage the signal's flags name rather than alongside connected handlers. It receives the
289
+ * emission's arguments without the leading emitter, with `this` bound to the emitter, and what it
290
+ * returns becomes the emission's result when the signal declares one. The same discovery walks the
291
+ * prototype chain vfunc discovery walks, and a subclass registering its own `on<SignalName>`
292
+ * replaces the handler for its instances, where `super.on<SignalName>()` reaches the replaced one.
293
+ * An `on`-prefixed method naming no signal the type carries is left alone as the ordinary method
294
+ * it is.
295
+ *
146
296
  * An override of `vfuncConstructed` runs from inside the base constructor, before JavaScript
147
297
  * installs the subclass's field initializers and runs its constructor body, so a field still
148
298
  * reads `undefined` there and reading a `#private` field throws. Declare state the override
@@ -155,6 +305,6 @@ type RegisterClassOptions<TInstance extends object, TProperties extends Record<s
155
305
  * @param options What the new GType gains beyond the vtable slots the class overrides.
156
306
  * @returns The same class, now registered, with every name in `options.properties` in its property map.
157
307
  */
158
- declare function registerClass<T extends AnyClass, TProperties extends Record<string, PropertySpec> = Record<never, PropertySpec>>(klass: T, options?: RegisterClassOptions<T["prototype"], TProperties>): RegisteredClass<T, TProperties>;
159
- export { type Interface, registerClass };
308
+ declare function registerClass<T extends AnyClass, TProperties extends Record<string, PropertySpec> = Record<never, PropertySpec>, TSignals extends Record<string, SignalSpec> = Record<never, SignalSpec>>(klass: T, options?: RegisterClassOptions<T["prototype"], TProperties, TSignals>): RegisteredClass<T, TProperties, TSignals>;
309
+ export { type Interface, registerClass, type SignalGType, type SignalSpec };
160
310
  //# sourceMappingURL=register-class.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-class.d.ts","sourceRoot":"","sources":["../src/register-class.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,QAAQ,EAAkC,MAAM,aAAa,CAAC;AAG5E,OAAO,EAMH,KAAK,YAAY,EAGpB,MAAM,iBAAiB,CAAC;AAWzB;;;;;;;;;GASG;AACH,KAAK,SAAS,CAAC,KAAK,IAAI,QAAQ,GAAG;IAC/B,qFAAqF;IACrF,Q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