feat(): typed @ionic/docs (#19547)

This commit is contained in:
Manu MA
2019-10-08 20:35:45 +02:00
committed by GitHub
parent bb32cea5c9
commit 3c4e65ba97
6 changed files with 14 additions and 13 deletions

View File

@@ -34,7 +34,7 @@
"tslib": "^1.10.0"
},
"devDependencies": {
"@stencil/core": "1.5.3",
"@stencil/core": "1.6.1",
"@stencil/sass": "1.0.1",
"@types/jest": "24.0.17",
"@types/node": "12.7.1",

View File

@@ -2,7 +2,6 @@ import { Build, Component, ComponentInterface, Element, Host, h } from '@stencil
import { config } from '../../global/config';
import { getIonMode } from '../../global/ionic-global';
import { rIC } from '../../utils/helpers';
import { isPlatform } from '../../utils/platform';
@Component({
@@ -52,3 +51,11 @@ export class App implements ComponentInterface {
const needInputShims = () => {
return isPlatform(window, 'ios') && isPlatform(window, 'mobile');
};
const rIC = (callback: () => void) => {
if ('requestIdleCallback' in window) {
(window as any).requestIdleCallback(callback);
} else {
setTimeout(callback, 32);
}
};

View File

@@ -1,7 +1,6 @@
import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Method, Prop, Watch, h } from '@stencil/core';
import { getIonMode } from '../../global/ionic-global';
import { rIC } from '../../utils/helpers.js';
import { SwiperInterface, SwiperOptions } from './swiper/swiper-interface';
@@ -142,7 +141,7 @@ export class Slides implements ComponentInterface {
childList: true,
subtree: true
});
rIC(() => this.initSwiper());
this.el.componentOnReady().then(() => this.initSwiper());
}
async disconnectedCallback() {

View File

@@ -19,14 +19,6 @@ export const raf = (h: any) => {
return setTimeout(h);
};
export const rIC = (callback: () => void) => {
if ('requestIdleCallback' in window) {
(window as any).requestIdleCallback(callback);
} else {
setTimeout(callback, 32);
}
};
export const hasShadowDom = (el: HTMLElement) => {
return !!el.shadowRoot && !!(el as any).attachShadow;
};

1
docs/.gitignore vendored
View File

@@ -1 +1,2 @@
core.json
core.d.ts

View File

@@ -3,8 +3,10 @@
"version": "4.10.2",
"description": "Pre-packaged API documentation for the Ionic docs.",
"main": "core.json",
"types": "core.d.ts",
"files": [
"core.json"
"core.json",
"core.d.ts"
],
"author": "Ionic Team",
"license": "MIT",