add go method to navigate ng routes
This commit is contained in:
parent
4c50f26050
commit
2049fc8833
@ -9,13 +9,16 @@ export interface Go extends Window {
|
|||||||
|
|
||||||
export interface GoCallback extends Window {
|
export interface GoCallback extends Window {
|
||||||
SetVersion: (value: string) => void;
|
SetVersion: (value: string) => void;
|
||||||
|
GoChangeRoute: (value: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { GoGetGames, GoRunGame, GoGetSessions } = window as unknown as Go;
|
let { GoGetGames, GoRunGame, GoGetSessions } = window as unknown as Go;
|
||||||
let { SetVersion } = window as unknown as GoCallback;
|
let { SetVersion, GoChangeRoute } = window as unknown as GoCallback;
|
||||||
|
|
||||||
let w = window as unknown as GoCallback;
|
let w = window as unknown as GoCallback;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// var register = function <Type>(name: string): void {
|
// var register = function <Type>(name: string): void {
|
||||||
// const event = new CustomEvent<Type>(`${name}_Callback`, {
|
// const event = new CustomEvent<Type>(`${name}_Callback`, {
|
||||||
// detail: value
|
// detail: value
|
||||||
@ -25,11 +28,11 @@ let w = window as unknown as GoCallback;
|
|||||||
|
|
||||||
// w.SetVersion = register<string>('SetVersion')
|
// w.SetVersion = register<string>('SetVersion')
|
||||||
|
|
||||||
// (<GoCallback>(<unknown>window)).SetVersion = function <T>(value: T): void {
|
(<GoCallback>(<unknown>window)).GoChangeRoute = function <T>(value: T): void {
|
||||||
// const event = new CustomEvent<T>('GetVersion_Callback', {
|
const event = new CustomEvent<T>('GoChangeRoute_Callback', {
|
||||||
// detail: value,
|
detail: value,
|
||||||
// });
|
});
|
||||||
// document.dispatchEvent(event);
|
document.dispatchEvent(event);
|
||||||
// };
|
};
|
||||||
|
|
||||||
export { GoGetGames, GoGetSessions, SetVersion, GoRunGame };
|
export { GoGetGames, GoGetSessions, SetVersion, GoRunGame, GoChangeRoute };
|
||||||
|
Loading…
Reference in New Issue
Block a user