-
Notifications
You must be signed in to change notification settings - Fork 52
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
1 parent
80628ca
commit 39d9e7d
Showing
9 changed files
with
46 additions
and
33 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,4 +1,5 @@ | ||
export * from './base'; | ||
export * from './environments/environment'; | ||
export * from './models'; | ||
export * from './services'; | ||
export {CoreModule} from './core.module'; |
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 @@ | ||
export * from './xplat-window.interface'; |
24 changes: 24 additions & 0 deletions
24
src/xplat/_lib_files/core/models/xplat-window.interface.ts
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,24 @@ | ||
export interface IXPlatWindow { | ||
navigator: any; | ||
location: any; | ||
localStorage: any; | ||
process?: any; | ||
require?: any; | ||
alert(msg: any): Promise<any>; | ||
confirm(msg: any): Promise<any>; | ||
setTimeout(handler: (...args: any[]) => void, timeout?: number): number; | ||
clearTimeout(timeoutId: number): void; | ||
setInterval( | ||
handler: (...args: any[]) => void, | ||
ms?: number, | ||
...args: any[] | ||
): number; | ||
clearInterval(intervalId: number): void; | ||
|
||
// ...expand support for more window methods as you needed here... | ||
} | ||
|
||
export type XPlatWindow = Partial< | ||
Pick<Window, Exclude<keyof Window, keyof IXPlatWindow>> | ||
> & | ||
IXPlatWindow; |
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,8 +1,12 @@ | ||
import { InjectionToken, Type } from '@angular/core'; | ||
import { IXPlatWindow } from '../models'; | ||
|
||
/** | ||
* Various InjectionTokens shared across all platforms | ||
* Always suffix with 'Token' for clarity and consistency | ||
*/ | ||
|
||
export const PlatformLanguageToken = new InjectionToken<string>('PlatformLanguage'); | ||
export const PlatformLanguageToken = new InjectionToken<string>('PlatformLanguageToken'); | ||
export const PlatformWindowToken = new InjectionToken<IXPlatWindow>( | ||
'PlatformWindowToken' | ||
); |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { AppService } from './app.service'; | ||
import { TNSWindowPlatformService } from './tns-window.service'; | ||
import { TNSWindowService } from './tns-window.service'; | ||
|
||
export const PROVIDERS: any[] = [ | ||
AppService, | ||
TNSWindowPlatformService | ||
TNSWindowService | ||
]; | ||
|
||
export * from './app.service'; |
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