mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
chore(exports): update core exports
This commit is contained in:
@ -3,19 +3,20 @@ import { configFromURL } from '../utils/config';
|
||||
import { isIOS } from '../utils/platform';
|
||||
import { Config } from './config';
|
||||
|
||||
const Ionic = (window as any).Ionic = (window as any).Ionic || {};
|
||||
|
||||
const Ionic = (window as any)['Ionic'] = (window as any)['Ionic'] || {};
|
||||
declare const Context: any;
|
||||
|
||||
// queue used to coordinate DOM reads and
|
||||
// write in order to avoid layout thrashing
|
||||
Object.defineProperty(Ionic, 'queue', {
|
||||
get: () => Context.queue
|
||||
get: () => Context['queue']
|
||||
});
|
||||
|
||||
// create the Ionic.config from raw config object (if it exists)
|
||||
// and convert Ionic.config into a ConfigApi that has a get() fn
|
||||
const config = Ionic.config = Context.config = new Config({
|
||||
...Ionic.config,
|
||||
const config = Ionic['config'] = Context['config'] = new Config({
|
||||
...Ionic['config'],
|
||||
...configFromURL()
|
||||
});
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
|
||||
// lifecycle
|
||||
export const enum ViewLifecycle {
|
||||
WillEnter = 'ionViewWillEnter',
|
||||
DidEnter = 'ionViewDidEnter',
|
||||
@ -6,10 +8,12 @@ export const enum ViewLifecycle {
|
||||
WillUnload = 'ionViewWillUnload',
|
||||
}
|
||||
|
||||
// Util functions
|
||||
// util functions
|
||||
export * from './utils/helpers';
|
||||
export * from './utils/haptic';
|
||||
export * from './utils/framework-delegate';
|
||||
export * from './utils/platform';
|
||||
export * from './utils/config';
|
||||
|
||||
// interface
|
||||
export * from './interface';
|
||||
|
3
core/src/interface.d.ts
vendored
3
core/src/interface.d.ts
vendored
@ -21,9 +21,6 @@ export * from './components/toast/toast-interface';
|
||||
export * from './utils/input-interface';
|
||||
export * from './global/config';
|
||||
|
||||
// export index
|
||||
export * from './index';
|
||||
|
||||
export type Color = 'default'| 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark';
|
||||
export type Mode = 'ios' | 'md';
|
||||
export type ComponentRef = Function | HTMLElement | string;
|
||||
|
@ -1,18 +1,4 @@
|
||||
|
||||
export function setupConfig(config: {[key: string]: any}) {
|
||||
const win = window as any;
|
||||
const Ionic = win.Ionic;
|
||||
if (Ionic && Ionic.config && Ionic.config.constructor.name !== 'Object') {
|
||||
console.error('ionic config was already initialized');
|
||||
return;
|
||||
}
|
||||
win.Ionic = win.Ionic || {};
|
||||
win.Ionic.config = {
|
||||
...win.Ionic.config,
|
||||
...config
|
||||
};
|
||||
return win.Ionic.config;
|
||||
}
|
||||
|
||||
export function configFromURL() {
|
||||
const config: any = {};
|
||||
|
Reference in New Issue
Block a user