-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add minimal example for shared interface code
- Loading branch information
Jonas Verhoelen
committed
May 5, 2019
1 parent
4aae6be
commit 4bb8f97
Showing
5 changed files
with
31 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
console.log('index.ts') | ||
const welcomePhrases = window.config.welcomePhrases | ||
|
||
const app: HTMLElement = document.getElementById('app')! | ||
app.innerHTML = welcomePhrases.map(phrase => `<h2>${phrase}</h2>`).join('') |
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,8 @@ | ||
export interface FrontendConfig { | ||
welcomePhrases: string[] | ||
} | ||
|
||
export interface FrontendContext { | ||
cssFiles?: string[] | ||
config: FrontendConfig | ||
} |
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,7 @@ | ||
import { FrontendConfig } from './FrontendContext' | ||
|
||
declare global { | ||
interface Window { | ||
config: FrontendConfig | ||
} | ||
} |