-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
3,317 additions
and
2,527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
export class DOMPointReadOnly { | ||
x: number = 0; | ||
y: number = 0; | ||
z: number = 0; | ||
w: number = 1; | ||
constructor(x = 0, y = 0, z = 0, w = 1) { | ||
if (typeof x === 'number') { | ||
this.x = x; | ||
} | ||
if (typeof y === 'number') { | ||
this.y = y; | ||
} | ||
if (typeof z === 'number') { | ||
this.z = z; | ||
} | ||
if (typeof w === 'number') { | ||
this.w = w; | ||
} | ||
} | ||
|
||
static fromPoint(value: DOMPointReadOnly | { x?: number; y?: number; z?: number; w?: number }) { | ||
if (value instanceof DOMPointReadOnly) { | ||
return new DOMPointReadOnly(value.x, value.y, value.z, value.y); | ||
} | ||
return new DOMPointReadOnly(value?.x ?? 0, value?.y ?? 0, value?.z ?? 0, value?.w ?? 1); | ||
} | ||
|
||
toJSON() { | ||
return { | ||
x: this.x, | ||
y: this.y, | ||
z: this.z, | ||
w: this.w, | ||
}; | ||
} | ||
} | ||
|
||
export class DOMPoint extends DOMPointReadOnly { | ||
static fromPoint(value: DOMPointReadOnly | DOMPoint | { x?: number; y?: number; z?: number; w?: number }) { | ||
if (value instanceof DOMPointReadOnly) { | ||
return new DOMPoint(value.x, value.y, value.z, value.y); | ||
} | ||
return new DOMPoint(value?.x ?? 0, value?.y ?? 0, value?.z ?? 0, value?.w ?? 1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export class HTMLCollection extends Array { | ||
item(index: number) { | ||
return this[index]; | ||
} | ||
|
||
namedItem(nameOrId: string) { | ||
// todo | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.