-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.d.ts
More file actions
165 lines (161 loc) · 6.55 KB
/
index.d.ts
File metadata and controls
165 lines (161 loc) · 6.55 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// Generated by dts-bundle v0.7.3
// Dependencies for this module:
// ../leaflet
// ../elt
declare module 'elt-leaflet' {
export * from 'elt-leaflet/map';
export * from 'elt-leaflet/grouper';
import * as L_ from 'leaflet';
export const L: typeof L_;
}
declare module 'elt-leaflet/map' {
import { Attrs, Component, Mixin, o } from 'elt';
import * as L from 'leaflet';
export interface MapAttributes extends Attrs {
center?: o.O<L.LatLng>;
bbox?: o.O<L.LatLngBounds>;
'center-ro'?: o.RO<L.LatLng | null>;
'bbox-ro'?: o.RO<L.LatLngBounds | null>;
zoom?: o.RO<number>;
tileLayer: string;
}
export class Map extends Component {
attrs: MapAttributes;
get leafletMap(): L.Map;
init(node: HTMLElement): void;
removed(): void;
panTo(ll: L.LatLng): void;
addLayer(layer: L.Layer): void;
render(children: DocumentFragment): Element;
}
export namespace Map {
const cls_container: import("osun").CssClass & string;
}
export type LeafletCallback<T extends L.LeafletEvent> = (ev: T) => any;
export interface MapWatcherCallbacks {
autopanstart?: LeafletCallback<L.LeafletEvent>;
baselayerchange?: LeafletCallback<L.LayersControlEvent>;
click?: LeafletCallback<L.LeafletMouseEvent>;
dblclick?: LeafletCallback<L.LeafletMouseEvent>;
keypress?: LeafletCallback<L.LeafletEvent>;
layeradd?: LeafletCallback<L.LayerEvent>;
layerremove?: LeafletCallback<L.LayerEvent>;
load?: LeafletCallback<L.LeafletEvent>;
locationerror?: LeafletCallback<L.ErrorEvent>;
locationfound?: LeafletCallback<L.LocationEvent>;
mousedown?: LeafletCallback<L.LeafletMouseEvent>;
mousemove?: LeafletCallback<L.LeafletMouseEvent>;
mouseout?: LeafletCallback<L.LeafletMouseEvent>;
mouseover?: LeafletCallback<L.LeafletMouseEvent>;
mouseup?: LeafletCallback<L.LeafletMouseEvent>;
move?: LeafletCallback<L.LeafletEvent>;
moveend?: LeafletCallback<L.LeafletEvent>;
movestart?: LeafletCallback<L.LeafletEvent>;
overlayadd?: LeafletCallback<L.LayersControlEvent>;
overlayremove?: LeafletCallback<L.LayersControlEvent>;
popupclose?: LeafletCallback<L.PopupEvent>;
popupopen?: LeafletCallback<L.PopupEvent>;
preclick?: LeafletCallback<L.LeafletMouseEvent>;
resize?: LeafletCallback<L.ResizeEvent>;
tooltipclose?: LeafletCallback<L.TooltipEvent>;
tooltipopen?: LeafletCallback<L.TooltipEvent>;
unload?: LeafletCallback<L.LeafletEvent>;
viewreset?: LeafletCallback<L.LeafletEvent>;
zoom?: LeafletCallback<L.LeafletEvent>;
zoomend?: LeafletCallback<L.LeafletEvent>;
zoomlevelschange?: LeafletCallback<L.LeafletEvent>;
zoomstart?: LeafletCallback<L.LeafletEvent>;
}
export class MapWatcher extends Mixin<Comment> {
callbacks: MapWatcherCallbacks;
leaflet_map: L.Map | null;
constructor(callbacks: MapWatcherCallbacks);
inserted(): void;
removed(): void;
}
export function WatchMap(callbacks: MapWatcherCallbacks): Node;
export class MarkerDisplayer extends Mixin<Comment> {
coords: o.RO<L.LatLngExpression>;
dom_marker: Element;
options: L.MarkerOptions;
marker: L.Marker;
constructor(coords: o.RO<L.LatLngExpression>, dom_marker: Element, options: L.MarkerOptions);
init(node: Node): void;
removed(node: Node): void;
}
export function DisplayMarker(coords: o.RO<L.LatLngExpression>, marker: Element, options?: L.MarkerOptions): Node;
export class LayerDisplayer extends Mixin<Comment> {
layers: o.RO<null | undefined | L.Layer | (null | undefined | L.Layer)[]>;
map: L.Map;
layer: L.LayerGroup;
constructor(layers: o.RO<null | undefined | L.Layer | (null | undefined | L.Layer)[]>);
init(node: Node): void;
removed(node: Node): void;
}
export function DisplayLayers(layers: o.RO<null | undefined | L.Layer | (null | undefined | L.Layer)[]>): Node;
}
declare module 'elt-leaflet/grouper' {
import { Mixin, o } from 'elt';
import * as L from 'leaflet';
export interface GroupPoint<T> extends L.Point {
x: number;
y: number;
visited: boolean;
index: number;
x_index: number;
y_index: number;
}
export interface Cluster<T> extends L.Point {
x: number;
y: number;
points: GroupPoint<T>[];
}
export type GrouperCallbackMulti<T> = (item: o.ArrayTransformObservable<T>, latlng: L.LatLng) => (Element | L.Marker);
export class Grouper<T> extends Mixin<Comment> {
extractor: (a: T) => L.LatLng;
list: o.Observable<T[]>;
multi: GrouperCallbackMulti<T>;
epsilon: number;
map: L.Map;
zoom_level: number;
cluster_layer: L.LayerGroup;
bound_recompute: () => void;
child_observables: o.Observable<any>[];
lst_x: GroupPoint<T>[];
lst_y: GroupPoint<T>[];
o_clusters: o.Observable<Cluster<T>[]>;
constructor(extractor: (a: T) => L.LatLng, list: o.Observable<T[]>, multi: GrouperCallbackMulti<T>, epsilon?: number);
/**
*
* @param point
* @param epsilon Une distance en pixels
*/
query(point: GroupPoint<T>, cluster: Cluster<T>, epsilon: number): void;
/**
* C'est dans cette méthode qu'on regroupe les items par liste et qu'on rassemble
* ceux qui ont la même localisation exactement.
*
* @param lst La liste à rentrer
*/
computeLists(): void;
/**
* Recompute the clusters or single points.
*/
recompute(): void;
removed(): void;
/**
*
*/
init(): void;
}
/**
*
* @param items La liste d'items que l'on va vouloir regrouper
* @param single L'affichage d'un item simple
* @param multi L'affichage d'une liste d'items sur les mêmes coordonnées
* @param regrouped L'affichage de plusieurs points regroupés par distance
*/
export function GeoGroup<T>(extractor: (a: T) => L.LatLng, items: o.Observable<T[]>, multi: GrouperCallbackMulti<T>, options?: {
epsilon: number;
}): Node;
}