Skip to content

Commit

Permalink
Move global declaration and DeviceInfo to declaration file
Browse files Browse the repository at this point in the history
  • Loading branch information
YouKnowBlom committed Oct 31, 2020
1 parent e6b2ba2 commit 4d5eeef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
import "./components/maincontroller";

declare global {
let PRODUCTION: boolean;
interface Window {
deviceInfo: deviceInfo;
mediaElement: HTMLElement;
playlist: Array<any>;
currentPlaylistIndex: number;
repeatMode: "RepeatOne" | "RepeatAll" | "RepeatNone";
}
}

interface deviceInfo {
deviceId: string | number,
deviceName: string,
versionNumber: string
}

const senders = cast.framework.CastReceiverContext.getInstance().getSenders();
const id = senders.length !== 0 && senders[0].id ? senders[0].id : new Date().getTime();

Expand Down
16 changes: 16 additions & 0 deletions src/types/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
declare global {
export let PRODUCTION: boolean;
export interface Window {
deviceInfo: DeviceInfo;
mediaElement: HTMLElement | null;
playlist: Array<any>;
currentPlaylistIndex: number;
repeatMode: "RepeatOne" | "RepeatAll" | "RepeatNone";
}
}

export interface DeviceInfo {
deviceId: string | number,
deviceName: string,
versionNumber: string
}

0 comments on commit 4d5eeef

Please sign in to comment.