1import { View } from "./view"; 2import { Class } from "./class"; 3import { Attrs } from "./types"; 4import { Signal0, Signal, ISignalable } from "./signaling"; 5import { Struct, Ref } from "./util/refs"; 6import * as p from "./properties"; 7import { Property } from "./properties"; 8import { serialize, Serializable, Serializer } from "./serializer"; 9import type { Document } from "../document/document"; 10import { equals, Equatable, Comparator } from "./util/eq"; 11import { pretty, Printable, Printer } from "./util/pretty"; 12import { clone, Cloneable, Cloner } from "./util/cloneable"; 13import * as kinds from "./kinds"; 14export declare module HasProps { 15 type Attrs = p.AttrsOf<Props>; 16 type Props = {}; 17 type SetOptions = { 18 check_eq?: boolean; 19 silent?: boolean; 20 no_change?: boolean; 21 setter_id?: string; 22 }; 23} 24export interface HasProps extends HasProps.Attrs, ISignalable { 25 constructor: Function & { 26 __name__: string; 27 __module__?: string; 28 __qualified__: string; 29 }; 30} 31export declare type PropertyGenerator = Generator<Property, void, undefined>; 32declare const HasProps_base: { 33 new (): { 34 connect<Args, Sender extends object>(signal: Signal<Args, Sender>, slot: import("./signaling").Slot<Args, Sender>): boolean; 35 disconnect<Args_1, Sender_1 extends object>(signal: Signal<Args_1, Sender_1>, slot: import("./signaling").Slot<Args_1, Sender_1>): boolean; 36 }; 37}; 38export declare abstract class HasProps extends HasProps_base implements Equatable, Printable, Serializable, Cloneable { 39 __view_type__: View; 40 readonly id: string; 41 get is_syncable(): boolean; 42 set type(name: string); 43 get type(): string; 44 static __name__: string; 45 static __module__?: string; 46 static get __qualified__(): string; 47 static get [Symbol.toStringTag](): string; 48 static init_HasProps(): void; 49 /** @prototype */ 50 default_view: Class<View, [View.Options]>; 51 /** @prototype */ 52 _props: { 53 [key: string]: { 54 type: p.PropertyConstructor<unknown>; 55 default_value?: (self: HasProps) => unknown; 56 options: p.PropertyOptions<unknown>; 57 }; 58 }; 59 /** @prototype */ 60 _mixins: [string, object][]; 61 private static _fix_default; 62 static define<T>(obj: Partial<p.DefineOf<T>> | ((types: typeof kinds) => Partial<p.DefineOf<T>>)): void; 63 static internal<T>(obj: Partial<p.DefineOf<T>> | ((types: typeof kinds) => Partial<p.DefineOf<T>>)): void; 64 static mixins<_T>(defs: Attrs | (Attrs | [string, Attrs])[]): void; 65 static override<T>(obj: Partial<p.DefaultsOf<T>>): void; 66 toString(): string; 67 _subtype: string | undefined; 68 document: Document | null; 69 readonly destroyed: Signal0<this>; 70 readonly change: Signal0<this>; 71 readonly transformchange: Signal0<this>; 72 readonly exprchange: Signal0<this>; 73 readonly properties: { 74 [key: string]: Property; 75 }; 76 property(name: string): Property; 77 get attributes(): Attrs; 78 [clone](cloner: Cloner): this; 79 [equals](that: this, cmp: Comparator): boolean; 80 [pretty](printer: Printer): string; 81 [serialize](serializer: Serializer): Ref; 82 constructor(attrs?: Attrs | Map<string, unknown>); 83 finalize(): void; 84 initialize(): void; 85 connect_signals(): void; 86 disconnect_signals(): void; 87 destroy(): void; 88 clone(): this; 89 private _pending; 90 private _changing; 91 private _setv; 92 setv(changed_attrs: Attrs, options?: HasProps.SetOptions): void; 93 /** @deprecated */ 94 getv(name: string): unknown; 95 ref(): Ref; 96 struct(): Struct; 97 set_subtype(subtype: string): void; 98 [Symbol.iterator](): PropertyGenerator; 99 syncable_properties(): PropertyGenerator; 100 /** @deprecated */ 101 serializable_attributes(): Attrs; 102 static _json_record_references(doc: Document, v: unknown, refs: Set<HasProps>, options: { 103 recursive: boolean; 104 }): void; 105 static _value_record_references(v: unknown, refs: Set<HasProps>, options: { 106 recursive: boolean; 107 }): void; 108 references(): Set<HasProps>; 109 protected _doc_attached(): void; 110 protected _doc_detached(): void; 111 attach_document(doc: Document): void; 112 detach_document(): void; 113 protected _needs_invalidate(old_value: unknown, new_value: unknown): boolean; 114 protected _push_changes(changes: [Property, unknown, unknown][], options?: { 115 setter_id?: string; 116 }): void; 117 on_change(properties: Property<unknown> | Property<unknown>[], fn: () => void): void; 118} 119export {}; 120//# sourceMappingURL=has_props.d.ts.map