-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(setPlatformOptions): add setPlatformOptions for ce builds
For custom element builds, export `setPlatformOptions(opts)`, which is similar to options that can be set within a lazy load `defineCustomElements()` options.
- Loading branch information
1 parent
1aa9cae
commit 12fec21
Showing
6 changed files
with
84 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { plt } from '@platform'; | ||
|
||
interface SetPlatformOptions { | ||
raf?: (c: FrameRequestCallback) => number; | ||
ael?: ( | ||
el: EventTarget, | ||
eventName: string, | ||
listener: EventListenerOrEventListenerObject, | ||
options: boolean | AddEventListenerOptions, | ||
) => void; | ||
rel?: ( | ||
el: EventTarget, | ||
eventName: string, | ||
listener: EventListenerOrEventListenerObject, | ||
options: boolean | AddEventListenerOptions, | ||
) => void; | ||
ce?: (eventName: string, opts?: any) => CustomEvent; | ||
} | ||
|
||
export const setPlatformOptions = (opts: SetPlatformOptions) => Object.assign(plt, opts); |