-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an EAP init hook and bind EAP methods to the plug scope
- Loading branch information
1 parent
702c289
commit a266f23
Showing
3 changed files
with
34 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import {SlotId, FetchResponse} from './fetch'; | ||
import {NullableJsonObject} from './sdk/json'; | ||
import {Plug} from './plug'; | ||
|
||
export interface EapFeatures { | ||
fetch<P extends NullableJsonObject, I extends SlotId = SlotId>(slotId: I): Promise<FetchResponse<I, P>>; | ||
fetch<P extends NullableJsonObject, I extends SlotId = SlotId>(this: Plug, slotId: I): Promise<FetchResponse<I, P>>; | ||
} | ||
|
||
interface EapHooks extends EapFeatures{ | ||
initialize(this: Plug): void; | ||
} | ||
|
||
declare global { | ||
interface Window { | ||
croctEap?: Partial<EapFeatures>; | ||
croctEap?: Partial<EapHooks>; | ||
} | ||
} |
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