cotomy 0.1.41 → 0.1.42

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/dist/view.d.ts CHANGED
@@ -104,15 +104,18 @@ export declare class CotomyElement {
104
104
  get isRightViewport(): boolean;
105
105
  hasAttribute(name: string): boolean;
106
106
  attribute(name: string): string | null | undefined;
107
- setAttribute(name: string, value?: string | number | undefined): this;
108
- removeAttribute(name: string): void;
109
- hasClass(cls: string): boolean;
110
- addClass(cls: string): this;
111
- removeClass(cls: string): this;
112
- setElementStyle(name: string, value: string): this;
113
- removeElementStyle(name: string): this;
114
- get computedStyle(): CSSStyleDeclaration;
107
+ attribute(name: string, value: string | number | undefined): this;
108
+ attribute(name: string, value: null): this;
109
+ hasClass(name: string): boolean;
110
+ addClass(name: string): this;
111
+ removeClass(name: string): this;
112
+ toggleClass(name: string, force?: boolean): this;
115
113
  style(name: string): string;
114
+ style(name: string, value: string): this;
115
+ style(name: string, value: null): this;
116
+ style(name: string, value: undefined): this;
117
+ protected getComputedStyle(): CSSStyleDeclaration;
118
+ computedStyle(name: string): string;
116
119
  get parent(): CotomyElement;
117
120
  get parents(): CotomyElement[];
118
121
  hasChildren(selector?: string): boolean;
@@ -130,46 +133,78 @@ export declare class CotomyElement {
130
133
  insertAfter(append: CotomyElement): this;
131
134
  appendTo(target: CotomyElement): this;
132
135
  prependTo(target: CotomyElement): this;
133
- trigger(event: string, e?: Event | null): this;
136
+ trigger(event: string): this;
137
+ trigger(event: string, e: Event): this;
134
138
  on(event: string, handle: (e: Event) => void | Promise<void>): this;
135
139
  onChild(event: string, selector: string, handle: (e: Event) => void | Promise<void>): this;
136
140
  once(event: string, handle: (e: Event) => void | Promise<void>): this;
137
- off(event: string, handle?: (e: Event) => void | Promise<void>): this;
141
+ off(event: string): this;
142
+ off(event: string, handle: (e: Event) => void | Promise<void>): this;
138
143
  handlers(event: string): Array<(e: Event) => void | Promise<void>>;
139
- click(handle?: ((e: MouseEvent) => void | Promise<void>) | null): this;
140
- dblclick(handle?: ((e: MouseEvent) => void | Promise<void>) | null): this;
141
- mouseover(handle?: ((e: MouseEvent) => void | Promise<void>) | null): this;
142
- mouseout(handle?: ((e: MouseEvent) => void | Promise<void>) | null): this;
143
- mousedown(handle?: ((e: MouseEvent) => void | Promise<void>) | null): this;
144
- mouseup(handle?: ((e: MouseEvent) => void | Promise<void>) | null): this;
145
- mousemove(handle?: ((e: MouseEvent) => void | Promise<void>) | null): this;
146
- mouseenter(handle?: ((e: MouseEvent) => void | Promise<void>) | null): this;
147
- mouseleave(handle?: ((e: MouseEvent) => void | Promise<void>) | null): this;
148
- dragstart(handle?: ((e: DragEvent) => void | Promise<void>) | null): this;
149
- dragend(handle?: ((e: DragEvent) => void | Promise<void>) | null): this;
150
- dragover(handle?: ((e: DragEvent) => void | Promise<void>) | null): this;
151
- dragenter(handle?: ((e: DragEvent) => void | Promise<void>) | null): this;
152
- dragleave(handle?: ((e: DragEvent) => void | Promise<void>) | null): this;
153
- drop(handle?: ((e: DragEvent) => void | Promise<void>) | null): this;
154
- drag(handle?: ((e: DragEvent) => void | Promise<void>) | null): this;
144
+ click(): this;
145
+ click(handle: (e: MouseEvent) => void | Promise<void>): this;
146
+ dblclick(): this;
147
+ dblclick(handle: (e: MouseEvent) => void | Promise<void>): this;
148
+ mouseover(): this;
149
+ mouseover(handle: (e: MouseEvent) => void | Promise<void>): this;
150
+ mouseout(): this;
151
+ mouseout(handle: (e: MouseEvent) => void | Promise<void>): this;
152
+ mousedown(): this;
153
+ mousedown(handle: (e: MouseEvent) => void | Promise<void>): this;
154
+ mouseup(): this;
155
+ mouseup(handle: (e: MouseEvent) => void | Promise<void>): this;
156
+ mousemove(): this;
157
+ mousemove(handle: (e: MouseEvent) => void | Promise<void>): this;
158
+ mouseenter(): this;
159
+ mouseenter(handle: (e: MouseEvent) => void | Promise<void>): this;
160
+ mouseleave(): this;
161
+ mouseleave(handle: (e: MouseEvent) => void | Promise<void>): this;
162
+ dragstart(): this;
163
+ dragstart(handle: (e: DragEvent) => void | Promise<void>): this;
164
+ dragend(): this;
165
+ dragend(handle: (e: DragEvent) => void | Promise<void>): this;
166
+ dragover(): this;
167
+ dragover(handle: (e: DragEvent) => void | Promise<void>): this;
168
+ dragenter(): this;
169
+ dragenter(handle: (e: DragEvent) => void | Promise<void>): this;
170
+ dragleave(): this;
171
+ dragleave(handle: (e: DragEvent) => void | Promise<void>): this;
172
+ drop(): this;
173
+ drop(handle: (e: DragEvent) => void | Promise<void>): this;
174
+ drag(): this;
175
+ drag(handle: (e: DragEvent) => void | Promise<void>): this;
155
176
  removed(handle: ((e: Event) => void | Promise<void>)): this;
156
- keydown(handle?: ((e: KeyboardEvent) => void | Promise<void>) | null): this;
157
- keyup(handle?: ((e: KeyboardEvent) => void | Promise<void>) | null): this;
158
- keypress(handle?: ((e: KeyboardEvent) => void | Promise<void>) | null): this;
159
- change(handle?: ((e: Event) => void | Promise<void>) | null): this;
160
- input(handle?: ((e: Event) => void | Promise<void>) | null): this;
177
+ keydown(): this;
178
+ keydown(handle: (e: KeyboardEvent) => void | Promise<void>): this;
179
+ keyup(): this;
180
+ keyup(handle: (e: KeyboardEvent) => void | Promise<void>): this;
181
+ keypress(): this;
182
+ keypress(handle: (e: KeyboardEvent) => void | Promise<void>): this;
183
+ change(): this;
184
+ change(handle: (e: Event) => void | Promise<void>): this;
185
+ input(): this;
186
+ input(handle: (e: Event) => void | Promise<void>): this;
161
187
  private static _intersectionObserver;
162
188
  static get intersectionObserver(): IntersectionObserver;
163
- inview(handle?: ((e: Event) => void | Promise<void>) | null): this;
164
- outview(handle?: ((e: Event) => void | Promise<void>) | null): this;
165
- focus(handle?: ((e: FocusEvent) => void | Promise<void>) | null): this;
166
- blur(handle?: ((e: FocusEvent) => void | Promise<void>) | null): this;
167
- focusin(handle?: ((e: FocusEvent) => void | Promise<void>) | null): this;
168
- focusout(handle?: ((e: FocusEvent) => void | Promise<void>) | null): this;
189
+ inview(): this;
190
+ inview(handle: (e: Event) => void | Promise<void>): this;
191
+ outview(): this;
192
+ outview(handle: (e: Event) => void | Promise<void>): this;
193
+ focus(): this;
194
+ focus(handle: (e: FocusEvent) => void | Promise<void>): this;
195
+ blur(): this;
196
+ blur(handle: (e: FocusEvent) => void | Promise<void>): this;
197
+ focusin(): this;
198
+ focusin(handle: (e: FocusEvent) => void | Promise<void>): this;
199
+ focusout(): this;
200
+ focusout(handle: (e: FocusEvent) => void | Promise<void>): this;
169
201
  filedrop(handle: (files: File[]) => void | Promise<void>): this;
170
- resize(handle?: ((e: Event) => void | Promise<void>) | null): this;
171
- scroll(handle?: ((e: Event) => void | Promise<void>) | null): this;
172
- changelayout(handle?: ((e: Event) => void | Promise<void>) | null): this;
202
+ resize(): this;
203
+ resize(handle: (e: Event) => void | Promise<void>): this;
204
+ scroll(): this;
205
+ scroll(handle: (e: Event) => void | Promise<void>): this;
206
+ changelayout(): this;
207
+ changelayout(handle: (e: Event) => void | Promise<void>): this;
173
208
  }
174
209
  export declare class CotomyMetaElement extends CotomyElement {
175
210
  static get(name: string): CotomyMetaElement;
@@ -195,10 +230,14 @@ export declare class CotomyWindow {
195
230
  handlers(event: string): Array<(e: Event) => void | Promise<void>>;
196
231
  load(handle: (e: Event) => void | Promise<void>): void;
197
232
  ready(handle: ((e: Event) => void | Promise<void>)): void;
198
- resize(handle?: ((event: Event) => void | Promise<void>) | null): void;
199
- scroll(handle?: ((event: Event) => void | Promise<void>) | null): void;
200
- changeLayout(handle?: ((event: Event) => void | Promise<void>) | null): void;
201
- pageshow(handle?: ((event: PageTransitionEvent) => void | Promise<void>) | null): void;
233
+ resize(): void;
234
+ resize(handle: (event: Event) => void | Promise<void>): void;
235
+ scroll(): void;
236
+ scroll(handle: (event: Event) => void | Promise<void>): void;
237
+ changeLayout(): void;
238
+ changeLayout(handle: (event: Event) => void | Promise<void>): void;
239
+ pageshow(): void;
240
+ pageshow(handle: (event: PageTransitionEvent) => void | Promise<void>): void;
202
241
  get scrollTop(): number;
203
242
  get scrollLeft(): number;
204
243
  get width(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cotomy",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [