feat(react): add initial react code. (#16748)

This commit is contained in:
Josh Thomas
2018-12-14 14:54:28 -06:00
committed by GitHub
parent 4053f386fd
commit 33e0ae4afa
11 changed files with 184 additions and 114 deletions

View File

@ -1,3 +1,26 @@
export { Delegate } from './react-framework-delegate';
export * from './apis/apis';
export * from './utils/wc-shim';
import { addIcons } from 'ionicons';
import { ICON_PATHS } from 'ionicons/icons';
import { IonicConfig } from '@ionic/core';
import { defineCustomElements } from '@ionic/core/loader';
export * from './components';
export interface IonicGlobal {
config?: any;
ael?: (elm: any, eventName: string, cb: (ev: Event) => void, opts: any) => void;
raf?: (ts: number) => void;
rel?: (elm: any, eventName: string, cb: (ev: Event) => void, opts: any) => void;
}
export interface IonicWindow extends Window {
Ionic: IonicGlobal;
}
export function registerIonic(config: IonicConfig = {}) {
const win: IonicWindow = window as any;
const Ionic = (win.Ionic = win.Ionic || {});
addIcons(ICON_PATHS);
Ionic.config = config;
defineCustomElements(window);
}