@gtkx/runtime 1.6.0 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/application-class.d.ts +1 -1
- package/dist/application-class.d.ts.map +1 -1
- package/dist/application-class.js +1 -2
- package/dist/application-class.js.map +1 -1
- package/dist/arg.d.ts +4 -1
- package/dist/arg.d.ts.map +1 -1
- package/dist/arg.js.map +1 -1
- package/dist/bind.d.ts.map +1 -1
- package/dist/bind.js +1 -9
- package/dist/bind.js.map +1 -1
- package/dist/callback.d.ts +6 -1
- package/dist/callback.d.ts.map +1 -1
- package/dist/callback.js +33 -21
- package/dist/callback.js.map +1 -1
- package/dist/closure.d.ts +3 -1
- package/dist/closure.d.ts.map +1 -1
- package/dist/closure.js +17 -6
- package/dist/closure.js.map +1 -1
- package/dist/descriptors.d.ts +22 -51
- package/dist/descriptors.d.ts.map +1 -1
- package/dist/descriptors.js +53 -27
- package/dist/descriptors.js.map +1 -1
- package/dist/fn.d.ts.map +1 -1
- package/dist/fn.js +23 -9
- package/dist/fn.js.map +1 -1
- package/dist/folded-lengths.d.ts +2 -1
- package/dist/folded-lengths.d.ts.map +1 -1
- package/dist/folded-lengths.js +17 -7
- package/dist/folded-lengths.js.map +1 -1
- package/dist/index.d.ts +2 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -24
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -2
- package/dist/internal.js.map +1 -1
- package/dist/native-value.d.ts +9 -1
- package/dist/native-value.d.ts.map +1 -1
- package/dist/native-value.js +20 -3
- package/dist/native-value.js.map +1 -1
- package/dist/properties.d.ts +1 -1
- package/dist/properties.d.ts.map +1 -1
- package/dist/properties.js +2 -11
- package/dist/properties.js.map +1 -1
- package/dist/register-class.d.ts +45 -249
- package/dist/register-class.d.ts.map +1 -1
- package/dist/register-class.js.map +1 -1
- package/dist/signal.d.ts.map +1 -1
- package/dist/signal.js +9 -22
- package/dist/signal.js.map +1 -1
- package/dist/t.d.ts +5 -21
- package/dist/t.d.ts.map +1 -1
- package/dist/t.js +1 -5
- package/dist/t.js.map +1 -1
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js +7 -1
- package/dist/type.js.map +1 -1
- package/dist/value.d.ts.map +1 -1
- package/dist/value.js +7 -1
- package/dist/value.js.map +1 -1
- package/dist/variant.d.ts +2 -6
- package/dist/variant.d.ts.map +1 -1
- package/dist/variant.js.map +1 -1
- package/dist/vfunc-call.d.ts.map +1 -1
- package/dist/vfunc-call.js +2 -11
- package/dist/vfunc-call.js.map +1 -1
- package/package.json +9 -5
- package/src/application-class.ts +2 -2
- package/src/arg.ts +4 -1
- package/src/bind.ts +1 -12
- package/src/callback.ts +53 -29
- package/src/closure.ts +31 -6
- package/src/descriptors.ts +95 -59
- package/src/fn.ts +31 -10
- package/src/folded-lengths.ts +23 -10
- package/src/index.ts +2 -24
- package/src/internal.ts +2 -2
- package/src/native-value.ts +24 -3
- package/src/properties.ts +3 -16
- package/src/register-class.ts +45 -249
- package/src/signal.ts +9 -34
- package/src/t.ts +5 -21
- package/src/type.ts +9 -1
- package/src/value.ts +9 -1
- package/src/variant.ts +2 -6
- package/src/vfunc-call.ts +3 -16
package/dist/properties.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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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AG,QAAQ,CAAC,EAAE,SAAS,EAAE,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;AAC/F,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,MAAc,EAAE,QAAgB;IAC7D,MAAM,QAAQ,GAAI,MAAuC,CAAC,cAAc,CAE3D,CAAC;IAEd,OAAO,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC;AAChC,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,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,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"]}
|
|
1
|
+
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../src/properties.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrF,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;AAC9C,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AACrD,MAAM,qBAAqB,GAAG,6DAA6D,CAAC;AAC5F,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,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AC;AACzG,CAAC;AAED,SAAS,qBAAqB,CAAC,MAA8B;IACzD,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,mBAAmB,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAE5C,OAAO,EAAE,SAAS,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,SAAS,EAAE,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;AAC/F,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,MAAc,EAAE,QAAgB;IAC7D,MAAM,QAAQ,GAAI,MAAuC,CAAC,cAAc,CAE3D,CAAC;IAEd,OAAO,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC;AAChC,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,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,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, 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 const checks = coercionChecks.getOrInsertComputed(gtype, () => new Map<string, PropertyCheck | null>());\n\n return checks.getOrInsertComputed(name, () => lookupCoercionCheck(gtype, name));\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"]}
|
package/dist/register-class.d.ts
CHANGED
|
@@ -1,309 +1,105 @@
|
|
|
1
1
|
import { type AnyClass } from "@gtkx/utils";
|
|
2
2
|
import { type PropertySpec } from "./properties.js";
|
|
3
3
|
import { type TypedClass } from "./type.js";
|
|
4
|
-
/**
|
|
5
|
-
* A generated interface value, such as `Gio.ListModel`, in the form {@link registerClass} takes it.
|
|
6
|
-
* `__impl__` exists only in the type system: it carries the interface's `Impl` type, of which a class
|
|
7
|
-
* has to match every member it declares itself, which rejects a class value and a member whose
|
|
8
|
-
* signature does not fit the slot it fills. Leaving a slot to the interface is not rejected,
|
|
9
|
-
* because `registerClass` does not reject it either: every member of an `Impl` type is optional,
|
|
10
|
-
* and the `Partial` holds that open whatever the type declares. The `object` beside it keeps
|
|
11
|
-
* TypeScript from also demanding one member in common. An interface that introspection describes
|
|
12
|
-
* no vtable for carries `unknown`, since it has no slot a class could fill.
|
|
13
|
-
*/
|
|
4
|
+
/** A generated interface value, such as `Gio.ListModel`, accepted by {@link registerClass}. */
|
|
14
5
|
type Interface<TImpl> = AnyClass & {
|
|
15
6
|
/** Type-level slot holding the interface's `Impl` type; no value ever carries it. */
|
|
16
7
|
__impl__: (impl: Partial<TImpl> & object) => void;
|
|
17
8
|
};
|
|
18
|
-
/**
|
|
19
|
-
* One key of `RegisterClassOptions.properties` with every underscore turned into the dash a canonical
|
|
20
|
-
* GObject property name separates its words with.
|
|
21
|
-
*/
|
|
9
|
+
/** Converts underscores in a property name to canonical dashes. */
|
|
22
10
|
type Dashed<TName extends string> = TName extends `${infer THead}_${infer TTail}` ? Dashed<`${THead}-${TTail}`> : TName;
|
|
23
|
-
/**
|
|
24
|
-
* One dashed key in the camelCase spelling the accessors {@link registerClass} installs carry, which is
|
|
25
|
-
* the spelling the hooks that address a property by name take.
|
|
26
|
-
*/
|
|
11
|
+
/** Converts a dashed property name to its JavaScript spelling. */
|
|
27
12
|
type Camelized<TName extends string> = TName extends `${infer THead}-${infer TTail}` ? `${THead}${Capitalize<Camelized<TTail>>}` : TName;
|
|
28
|
-
/**
|
|
29
|
-
* The names a registered class carries in its property map: every key of
|
|
30
|
-
* `RegisterClassOptions.properties` in camelCase, whichever spelling it was written in.
|
|
31
|
-
* A `properties` object given a type of its own rather than left to inference has `string` for its key
|
|
32
|
-
* type and names nothing, because a name only known as `string` addresses no member in particular.
|
|
33
|
-
*/
|
|
13
|
+
/** Property-map keys in the camelCase spelling hooks use. */
|
|
34
14
|
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
|
-
*/
|
|
15
|
+
/** Declared signal names in their original and canonical spellings. */
|
|
40
16
|
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
|
-
*/
|
|
17
|
+
/** Declared signal names, including detailed forms. */
|
|
46
18
|
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
|
-
*/
|
|
19
|
+
/** Signal methods added for declared names. */
|
|
53
20
|
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
|
-
*/
|
|
21
|
+
/** Type-level map used by signal hooks. */
|
|
58
22
|
__signals__?: Record<DeclaredSignalBase<TSignals>, (...args: never[]) => unknown>;
|
|
59
|
-
/** Connects a handler
|
|
23
|
+
/** Connects a handler. */
|
|
60
24
|
connect(signal: DeclaredSignalName<TSignals>, handler: (...args: never[]) => unknown, isAfter?: boolean): number;
|
|
61
|
-
/** Emits a signal
|
|
25
|
+
/** Emits a signal. */
|
|
62
26
|
emit(sigName: DeclaredSignalName<TSignals>, ...args: unknown[]): unknown;
|
|
63
|
-
/** Connects a handler
|
|
27
|
+
/** Connects a removable handler. */
|
|
64
28
|
on(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;
|
|
65
|
-
/** Connects a
|
|
29
|
+
/** Connects a one-shot handler. */
|
|
66
30
|
once(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;
|
|
67
|
-
/** Disconnects a handler
|
|
31
|
+
/** Disconnects a handler. */
|
|
68
32
|
off(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown): unknown;
|
|
69
33
|
};
|
|
70
|
-
/**
|
|
71
|
-
* An instance of a registered class: everything the class itself declares, plus the property map the
|
|
72
|
-
* hooks that address a property by name, such as `useProperty` from `@gtkx/react`, read the installed
|
|
73
|
-
* names off. Each name is typed with the value type the class declares for the member of that name,
|
|
74
|
-
* so a property the class does not `declare` contributes nothing.
|
|
75
|
-
*/
|
|
34
|
+
/** A registered instance with declared signal methods and property metadata. */
|
|
76
35
|
type RegisteredInstance<TInstance, TProperties, TSignals> = TInstance & DeclaredSignalMethods<TSignals> & {
|
|
77
36
|
/** Type-level map from installed property name to value type; no value ever carries it. */
|
|
78
37
|
__properties__: Pick<TInstance, InstalledNames<TProperties> & keyof TInstance>;
|
|
79
38
|
};
|
|
80
|
-
/**
|
|
81
|
-
* The construct signature and prototype a registered class carries, both giving
|
|
82
|
-
* {@link RegisteredInstance}. The signature stays abstract for as long as the class itself is, so
|
|
83
|
-
* registering an abstract base leaves it as impossible to construct as it was.
|
|
84
|
-
*/
|
|
39
|
+
/** A registered class's construct signature and prototype. */
|
|
85
40
|
type RegisteredConstructor<TClass, TArgs extends unknown[], TInstance> = {
|
|
86
41
|
/** Object the class's instances inherit from. */
|
|
87
42
|
prototype: TInstance;
|
|
88
43
|
} & (TClass extends new (...args: never) => unknown ? new (...args: TArgs) => TInstance : abstract new (...args: TArgs) => TInstance);
|
|
89
44
|
/** The statics a registered class keeps from the class it was, joined with {@link RegisteredConstructor}. */
|
|
90
45
|
type RegisteredParts<TClass, TArgs extends unknown[], TInstance> = Omit<TClass, "prototype"> & RegisteredConstructor<TClass, TArgs, TInstance>;
|
|
91
|
-
/**
|
|
92
|
-
* The class {@link registerClass} hands back: the same class, with the same statics, whose instances
|
|
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
|
-
*/
|
|
46
|
+
/** The registered class with its declared properties and signals. */
|
|
97
47
|
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
|
-
*/
|
|
48
|
+
/** A numeric GType or a generated or registered wrapper class. */
|
|
103
49
|
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.
|
|
108
|
-
*/
|
|
50
|
+
/** A signal installed by {@link registerClass}. */
|
|
109
51
|
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
|
-
*/
|
|
52
|
+
/** `GObject.SignalFlags` bit mask, defaulting to `RUN_FIRST`. */
|
|
114
53
|
flags?: number;
|
|
115
|
-
/**
|
|
54
|
+
/** Argument GTypes, defaulting to none. */
|
|
116
55
|
paramTypes?: SignalGType[];
|
|
117
|
-
/** GType
|
|
56
|
+
/** Return GType, defaulting to none. */
|
|
118
57
|
returnType?: SignalGType;
|
|
119
|
-
/**
|
|
120
|
-
* How the emission combines what its handlers return, limited to the 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
|
-
*/
|
|
58
|
+
/** Combines handler results; omitted means the last result wins. */
|
|
125
59
|
accumulator?: "first-wins" | "true-handled";
|
|
126
60
|
};
|
|
127
61
|
/** What {@link registerClass} adds to the new GType beyond the vtable slots it discovers on the class. */
|
|
128
62
|
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
|
-
*/
|
|
63
|
+
/** Registered GType name, defaulting to the class name. */
|
|
134
64
|
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
|
-
*/
|
|
65
|
+
/** Prevents direct construction while allowing registered subclasses. */
|
|
140
66
|
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
|
-
*/
|
|
67
|
+
/** CSS node name for a `Gtk.Widget` subclass. */
|
|
147
68
|
cssName?: string;
|
|
148
69
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
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.
|
|
70
|
+
* Runs once after registration with the wrapped class struct. An exception propagates after
|
|
71
|
+
* the static GType has already been registered and cannot be undone.
|
|
160
72
|
*/
|
|
161
73
|
classInit?(typeStruct: object): void;
|
|
162
|
-
/**
|
|
163
|
-
* Interfaces the new type implements on top of the ones it inherits, given as the interface values
|
|
164
|
-
* themselves, such as `Gio.ListModel`. Their vtable slots are filled from the `vfunc`-prefixed methods on
|
|
165
|
-
* the class's prototype chain, each of which has to match the interface's `Impl` type, such as
|
|
166
|
-
* `Gio.ListModelImpl`.
|
|
167
|
-
*/
|
|
74
|
+
/** Interfaces implemented through matching `vfunc` methods. */
|
|
168
75
|
implements?: Interface<TInstance>[];
|
|
169
76
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
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
|
|
182
|
-
* unless the class already defines that name. They serve the value from storage of their own on
|
|
183
|
-
* the instance, which is also what the type's `get_property` and `set_property` slots read and
|
|
184
|
-
* write, so a value set from JavaScript, from `g_object_set_property` and at construction all
|
|
185
|
-
* land in the same place.
|
|
186
|
-
*
|
|
187
|
-
* A write the ParamSpec would refuse throws rather than reaching GObject, which reports such a
|
|
188
|
-
* write as a GLib critical and drops it: a `TypeError` for a read-only or construct-only
|
|
189
|
-
* property and for a value of a type the property cannot hold, and a `RangeError` for a value
|
|
190
|
-
* the ParamSpec rejects. The same checks run over a value handed to the constructor, where
|
|
191
|
-
* a construct-only property is the one that is writable. An accepted write emits one `notify`,
|
|
192
|
-
* which a `freeze_notify` batch collects; a write of the value the property already holds is
|
|
193
|
-
* dropped and emits none.
|
|
194
|
-
*
|
|
195
|
-
* `null` and `undefined` both mean NULL, and mean it only where the ParamSpec's own type holds
|
|
196
|
-
* NULL, which is a string, string-array, boxed, object, interface, param, variant or pointer
|
|
197
|
-
* property. Such a property holds the `null` either spelling wrote, so the member, the type's
|
|
198
|
-
* `get_property` slot and `g_object_get_property` serve the same thing, and writing the other
|
|
199
|
-
* spelling over it emits no `notify`. Every other property, so every integer, floating-point,
|
|
200
|
-
* boolean, enum, flags and GType one, refuses both with the same `TypeError` it refuses a
|
|
201
|
-
* string with, and keeps the value it already holds. It refuses them for what it holds rather
|
|
202
|
-
* than for its range, whatever that range is: the type is checked before the range, so a
|
|
203
|
-
* `gint` whose range excludes 0 answers a nullish with that same `TypeError` and never with
|
|
204
|
-
* the `RangeError` that names the value GObject would put in its place. The one place
|
|
205
|
-
* `undefined` means something else is the constructor, which reads it as the property not
|
|
206
|
-
* being given at all and leaves it at the ParamSpec's default, so a property is never handed a
|
|
207
|
-
* value it cannot serve back.
|
|
208
|
-
*
|
|
209
|
-
* A floating-point property takes every JavaScript number, `NaN` and both infinities
|
|
210
|
-
* included, and its ParamSpec alone rules on which of them the range admits: a `gdouble`
|
|
211
|
-
* bounded by `-Infinity` and `Infinity` holds either infinity, and a magnitude a bounded
|
|
212
|
-
* one excludes, like any `NaN`, comes back as the `RangeError` that names what GObject
|
|
213
|
-
* would put in its place rather than as the `TypeError` a type the property cannot hold
|
|
214
|
-
* earns. A `gfloat` property holds what GObject narrows the double to, so it serves `0.1`
|
|
215
|
-
* back as `0.10000000149011612` and a finite magnitude no `gfloat` reaches as an infinity,
|
|
216
|
-
* which the range then rules on in turn. That narrowing belongs to the property alone: the
|
|
217
|
-
* same magnitude written to a `gfloat` through a generated binding, a signal argument or a
|
|
218
|
-
* closure return is refused outright rather than narrowed.
|
|
219
|
-
*
|
|
220
|
-
* A generated property of a wrapped type answers a nullish differently, and the two halves of
|
|
221
|
-
* the API disagree here: that property marshals what it is written through its descriptor
|
|
222
|
-
* rather than through the checks above, so `new Gtk.Label({ widthRequest: null })` and a later
|
|
223
|
-
* write of `null` to that member both land 0, where a `gint` installed here refuses both.
|
|
224
|
-
*
|
|
225
|
-
* A class that defines the camelCase member itself owns the property: its own accessor decides
|
|
226
|
-
* what a write means, the other spellings forward to it, and the type's property slots read
|
|
227
|
-
* and write it rather than the generated storage.
|
|
77
|
+
* ParamSpecs keyed by their JavaScript property names. Keys and ParamSpec names must canonicalize
|
|
78
|
+
* to the same member. Writes validate flags, types, and ranges and notify only on changes.
|
|
79
|
+
* Nullish values require a nullable GType; constructor `undefined` means omitted. An existing
|
|
80
|
+
* camelCase accessor remains authoritative.
|
|
228
81
|
*/
|
|
229
82
|
properties?: TProperties;
|
|
230
83
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
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. Either word separator spells 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}.
|
|
84
|
+
* New canonical signal names and specs. Declared GTypes validate emissions, and a matching
|
|
85
|
+
* `on<SignalName>` method becomes the default handler.
|
|
252
86
|
*/
|
|
253
87
|
signals?: TSignals;
|
|
254
88
|
};
|
|
255
89
|
/**
|
|
256
|
-
* Registers a
|
|
257
|
-
*
|
|
258
|
-
* `
|
|
259
|
-
*
|
|
260
|
-
* Throws when the class does not extend a registered wrapper class, when it has no derivable type
|
|
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
|
|
263
|
-
* listed interface has a prerequisite that neither the parent type nor another listed interface meets,
|
|
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.
|
|
274
|
-
*
|
|
275
|
-
* A slot is filled from the `vfunc`-prefixed methods on the class's prototype chain, up to but not
|
|
276
|
-
* including the registered ancestor the class extends, so a method an intermediate base class
|
|
277
|
-
* declares fills a slot the same way one the class itself declares does. A slot nothing on that
|
|
278
|
-
* chain fills is left untouched.
|
|
279
|
-
*
|
|
280
|
-
* Declare every slot as a method: a class field holding a function, such as `vfuncGetNItems = () => 1`,
|
|
281
|
-
* is assigned to each instance after registration and never reaches the vtable.
|
|
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.
|
|
90
|
+
* Registers a wrapper subclass as a GType with discovered vfuncs, properties, signals, and interfaces.
|
|
91
|
+
* Vfuncs must be prototype methods; function-valued fields never reach the vtable. A matching
|
|
92
|
+
* `on<SignalName>` method becomes the signal's default handler.
|
|
295
93
|
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* touches without an initializer, and assign private state from the constructor body after
|
|
300
|
-
* `super()`. An instance a native caller creates, through `GObject.newv` or `Gtk.Builder`,
|
|
301
|
-
* never runs the subclass constructor at all, so its declared fields stay uninitialized for
|
|
302
|
-
* the object's whole life.
|
|
94
|
+
* `vfuncConstructed` runs before field initializers and the constructor body. Native-created
|
|
95
|
+
* instances never run the JavaScript constructor, so native-required state belongs in properties
|
|
96
|
+
* or `vfuncConstructed`. A new `Gio.AsyncInitable` must implement `vfuncInitAsync`.
|
|
303
97
|
*
|
|
304
|
-
* @param klass The subclass to register.
|
|
305
|
-
* @param options
|
|
306
|
-
* @returns The
|
|
98
|
+
* @param klass The wrapper subclass to register.
|
|
99
|
+
* @param options Additional GType configuration.
|
|
100
|
+
* @returns The registered class with declared properties and signals in its type.
|
|
101
|
+
* @throws For invalid parents, names, interfaces, vfuncs, properties, signals, or widget options.
|
|
102
|
+
* A `classInit` exception propagates after the static type has been registered and cannot be undone.
|
|
307
103
|
*/
|
|
308
104
|
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
105
|
export { type Interface, registerClass, type SignalGType, type SignalSpec };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-class.d.ts","sourceRoot":"","sources":["../src/register-class.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,QAAQ,EAA6C,MAAM,aAAa,CAAC;AAGvF,OAAO,EAMH,KAAK,YAAY,EAGpB,MAAM,iBAAiB,CAAC;AAqBzB,OAAO,EAIH,KAAK,UAAU,EAMlB,MAAM,WAAW,CAAC;AAGnB
|
|
1
|
+
{"version":3,"file":"register-class.d.ts","sourceRoot":"","sources":["../src/register-class.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,QAAQ,EAA6C,MAAM,aAAa,CAAC;AAGvF,OAAO,EAMH,KAAK,YAAY,EAGpB,MAAM,iBAAiB,CAAC;AAqBzB,OAAO,EAIH,KAAK,UAAU,EAMlB,MAAM,WAAW,CAAC;AAGnB,+FAA+F;AAC/F,KAAK,SAAS,CAAC,KAAK,IAAI,QAAQ,GAAG;IAC/B,qFAAqF;IACrF,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CA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