1 | import { EventsKey } from './events';
|
2 | import BaseEvent from './events/Event';
|
3 | import Observable from './Observable';
|
4 |
|
5 | export default class BaseObject extends Observable {
|
6 | constructor(opt_values?: { [key: string]: any });
|
7 | /**
|
8 | * Apply any properties from another object without triggering events.
|
9 | */
|
10 | protected applyProperties(source: BaseObject): void;
|
11 | /**
|
12 | * Gets a value.
|
13 | */
|
14 | get(key: string): any;
|
15 | /**
|
16 | * Get a list of object property names.
|
17 | */
|
18 | getKeys(): string[];
|
19 | /**
|
20 | * Get an object of all property names and values.
|
21 | */
|
22 | getProperties(): { [key: string]: any };
|
23 | hasProperties(): boolean;
|
24 | notify(key: string, oldValue: any): void;
|
25 | |
26 |
|
27 |
|
28 | set(key: string, value: any, opt_silent?: boolean): void;
|
29 | |
30 |
|
31 |
|
32 |
|
33 | setProperties(values: { [key: string]: any }, opt_silent?: boolean): void;
|
34 | |
35 |
|
36 |
|
37 | unset(key: string, opt_silent?: boolean): void;
|
38 | on(type: string | string[], listener: (p0: any) => any): EventsKey | EventsKey[];
|
39 | once(type: string | string[], listener: (p0: any) => any): EventsKey | EventsKey[];
|
40 | un(type: string | string[], listener: (p0: any) => any): void;
|
41 | on(type: 'change', listener: (evt: BaseEvent) => void): EventsKey;
|
42 | once(type: 'change', listener: (evt: BaseEvent) => void): EventsKey;
|
43 | un(type: 'change', listener: (evt: BaseEvent) => void): void;
|
44 | on(type: 'error', listener: (evt: BaseEvent) => void): EventsKey;
|
45 | once(type: 'error', listener: (evt: BaseEvent) => void): EventsKey;
|
46 | un(type: 'error', listener: (evt: BaseEvent) => void): void;
|
47 | on(type: 'propertychange', listener: (evt: ObjectEvent) => void): EventsKey;
|
48 | once(type: 'propertychange', listener: (evt: ObjectEvent) => void): EventsKey;
|
49 | un(type: 'propertychange', listener: (evt: ObjectEvent) => void): void;
|
50 | }
|
51 | export class ObjectEvent extends BaseEvent {
|
52 | constructor(type: string, key: string, oldValue: any);
|
53 | /**
|
54 | * The name of the property whose value is changing.
|
55 | */
|
56 | key: string;
|
57 | /**
|
58 | * The old value. To get the new value use e.target.get(e.key) where
|
59 | * e is the event object.
|
60 | */
|
61 | oldValue: any;
|
62 | }
|
63 | export function getChangeEventType(key: string): string;
|