-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathinfinite-canvas.ts
More file actions
79 lines (74 loc) · 4.19 KB
/
Copy pathinfinite-canvas.ts
File metadata and controls
79 lines (74 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import type {Config} from "./config";
import { Units } from "./units";
import type {InfiniteCanvasRenderingContext2D} from "./infinite-canvas-rendering-context-2d";
import type {EventMap} from "./event-map";
import type { TransformationEvent } from "./transformation-event";
import type { Transformed } from './transformed';
export interface InfiniteCanvasEventHandlers extends GlobalEventHandlers {
/**
* The [event handler property](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_handler_properties) for the {@link EventMap.transformationstart} event
*/
ontransformationstart: ((this: InfiniteCanvas, event: TransformationEvent) => any) | null;
/**
* The [event handler property](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_handler_properties) for the {@link EventMap.transformationchange} event
*/
ontransformationchange: ((this: InfiniteCanvas, event: TransformationEvent) => any) | null;
/**
* The [event handler property](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_handler_properties) for the {@link EventMap.transformationend} event
*/
ontransformationend: ((this: InfiniteCanvas, event: TransformationEvent) => any) | null;
/**
* The [event handler property](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_handler_properties) for the {@link EventMap.draw} event
*/
ondraw: ((this: InfiniteCanvas, event: TransformationEvent) => any) | null;
/**
* The [event handler property](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_handler_properties) for the {@link EventMap.wheelignored} event
*/
onwheelignored: ((this: InfiniteCanvas, event: Event) => any) | null;
/**
* The [event handler property](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_handler_properties) for the {@link EventMap.touchignored} event
*/
ontouchignored: ((this: InfiniteCanvas, event: Event) => any) | null;
/**
* See [`addEventListener`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
*/
addEventListener<K extends keyof EventMap>(type: K, listener: (this: InfiniteCanvas, ev: EventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
/**
* See [`removeEventListener`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener)
*/
removeEventListener<K extends keyof EventMap>(type: K, listener: (this: InfiniteCanvas, ev: EventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
export interface InfiniteCanvas extends Config, InfiniteCanvasEventHandlers, Transformed{
/**
* This methods return the {@link InfiniteCanvasRenderingContext2D} belonging to this instance of {@link InfiniteCanvas}
*
* @param contextType for (partial) compatibility with the other [getContext()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext)
*/
getContext(contextType?: '2d'): InfiniteCanvasRenderingContext2D;
}
export interface InfiniteCanvasCtr {
/**
* Creates a new instance of an {@link InfiniteCanvas}
*
* @param canvas The canvas on which to draw the {@link InfiniteCanvas}
* @param config The {@link InfiniteCanvas}'s initial configuration
*/
new(canvas: HTMLCanvasElement, config?: Partial<Config>): InfiniteCanvas;
prototype: InfiniteCanvas;
/**
* Static property with a value of {@link Units.CANVAS}
*/
CANVAS_UNITS: Units;
/**
* Static property with a value of {@link Units.CSS}
*/
CSS_UNITS: Units;
};
declare var InfiniteCanvasConstructor: InfiniteCanvasCtr;
export * from './config'
export * from './event-map'
export * from './infinite-canvas-rendering-context-2d'
export * from './units'
export default InfiniteCanvasConstructor;