mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
# Conflicts: # amcharts/AmCharts.d.ts # angular-gettext/angular-gettext.d.ts # angular-jwt/angular-jwt.d.ts # angular-material/angular-material.d.ts # angularjs/angular.d.ts # auth0-js/auth0-js.d.ts # aws-lambda/aws-lambda.d.ts # aws-sdk/aws-sdk.d.ts # azure-mobile-apps/azure-mobile-apps.d.ts # azure-mobile-services-client/AzureMobileServicesClient.d.ts # blessed/blessed-tests.ts # blessed/blessed.d.ts # bootbox/bootbox.d.ts # bowser/bowser.d.ts # cache-manager/cache-manager.d.ts # chai-things/chai-things.d.ts # colors/colors.d.ts # cordova/cordova-tests.ts # cordova/plugins/Contacts.d.ts # cordova/plugins/FileSystem.d.ts # couchbase/couchbase.d.ts # cucumber/cucumber-tests.ts # cucumber/cucumber.d.ts # d3/d3.d.ts # dojo/dojo.d.ts # dustjs-linkedin/dustjs-linkedin.d.ts # esprima/esprima.d.ts # express-serve-static-core/express-serve-static-core.d.ts # express-session/express-session.d.ts # fetch-mock/fetch-mock.d.ts # fs-extra/fs-extra.d.ts # fullCalendar/fullCalendar.d.ts # github-electron/github-electron.d.ts # gulp-uglify/gulp-uglify.d.ts # gulp/gulp.d.ts # highcharts/highcharts.d.ts # imap/imap.d.ts # incremental-dom/incremental-dom.d.ts # inversify/inversify.d.ts # ionic/ionic.d.ts # ioredis/ioredis.d.ts # isomorphic-fetch/isomorphic-fetch-tests.ts # jake/jake.d.ts # joi/joi.d.ts # jquery-mockjax/jquery-mockjax.d.ts # jquery/jquery.d.ts # js-data-http/js-data-http-tests.ts # js-data-http/js-data-http.d.ts # js-data/js-data.d.ts # jsdom/jsdom.d.ts # jsts/jsts-tests.ts # knex/knex.d.ts # koa-favicon/koa-favicon.d.ts # koa-router/koa-router-tests.ts # koa-router/koa-router.d.ts # lodash/lodash.d.ts # mailparser/mailparser.d.ts # maquette/maquette.d.ts # material-ui/material-ui.d.ts # matter-js/matter-js.d.ts # moment/moment.d.ts # mongoose-promise/mongoose-promise-tests.ts # mongoose/mongoose-tests.ts # mongoose/mongoose.d.ts # multer/multer.d.ts # ncp/ncp.d.ts # nock/nock.d.ts # node/node-tests.ts # node/node.d.ts # nvd3/nvd3.d.ts # object-assign/object-assign.d.ts # openlayers/openlayers.d.ts # parse/parse.d.ts # pdf/pdf.d.ts # pdfkit/pdfkit.d.ts # pg/pg.d.ts # pixi.js/pixi.js.d.ts # progress/progress.d.ts # pusher-js/pusher-js.d.ts # quill/quill-tests.ts # quill/quill.d.ts # radium/radium.d.ts # ravenjs/ravenjs-tests.ts # react-dropzone/react-dropzone.d.ts # react-mdl/react-mdl.d.ts # react-native/react-native.d.ts # react-notification-system/react-notification-system.d.ts # react-router/history-tests.ts # react-router/react-router-tests.tsx # react-router/react-router.d.ts # react-select/react-select-tests.tsx # react-select/react-select.d.ts # react/react.d.ts # redux-form/redux-form.d.ts # request-promise/request-promise.d.ts # resolve-from/resolve-from.d.ts # riot-api-nodejs/riot-api-nodejs.d.ts # sanitize-html/sanitize-html.d.ts # segment-analytics/segment-analytics.d.ts # simple-assign/simple-assign-tests.ts # simple-assign/simple-assign.d.ts # slate-irc/slate-irc.d.ts # soap/soap.d.ts # socket.io/socket.io.d.ts # sql.js/sql.js-tests.ts # sql.js/sql.js.d.ts # steam/steam.d.ts # stylus/stylus.d.ts # swiper/swiper.d.ts # tedious/tedious.d.ts # threejs/three.d.ts # twilio/twilio.d.ts # underscore/underscore.d.ts # ws/ws.d.ts # yeoman-generator/yeoman-generator.d.ts
398 lines
14 KiB
TypeScript
398 lines
14 KiB
TypeScript
// Type definitions for Ionic
|
||
// Project: http://ionicframework.com
|
||
// Definitions by: Spencer Williams <https://github.com/spencerwi/>
|
||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||
|
||
/// <reference types="angular" />
|
||
|
||
interface IonicStatic {
|
||
/**
|
||
* What Ionic package version is.
|
||
*/
|
||
version: string;
|
||
Platform: {
|
||
/**
|
||
* Trigger a callback once the device is ready, or immediately
|
||
* if the device is already ready. This method can be run from
|
||
* anywhere and does not need to be wrapped by any additonal methods.
|
||
* When the app is within a WebView (Cordova), it’ll fire
|
||
* the callback once the device is ready. If the app is within
|
||
* a web browser, it’ll fire the callback after window.load.
|
||
* Please remember that Cordova features (Camera, FileSystem, etc) still
|
||
* will not work in a web browser.
|
||
*/
|
||
ready(callback: ()=>any): void;
|
||
/**
|
||
* Set the grade of the device: ‘a’, ‘b’, or ‘c’. ‘a’ is the best
|
||
* (most css features enabled), ‘c’ is the worst. By default, sets the grade
|
||
* depending on the current device.
|
||
*/
|
||
setGrade(grade: string): void;
|
||
/**
|
||
* Return the current device (given by cordova).
|
||
*/
|
||
device(): any;
|
||
/**
|
||
* Check if the platform name provided is detected.
|
||
*/
|
||
is(platformName: string): boolean;
|
||
/**
|
||
* Check if we are running within a WebView (such as Cordova).
|
||
*/
|
||
isWebView(): boolean;
|
||
/**
|
||
* Whether we are running on iPad.
|
||
*/
|
||
isIPad(): boolean;
|
||
/**
|
||
* Whether we are running on iOS.
|
||
*/
|
||
isIOS(): boolean;
|
||
/**
|
||
* Whether we are running on Android.
|
||
*/
|
||
isAndroid(): boolean;
|
||
/**
|
||
* Whether we are running on Windows Phone.
|
||
*/
|
||
isWindowsPhone(): boolean;
|
||
/**
|
||
* The name of the current platform.
|
||
*/
|
||
platform(): string;
|
||
/**
|
||
* The version of the current device platform.
|
||
*/
|
||
version(): number;
|
||
/**
|
||
* Exit the app.
|
||
*/
|
||
exitApp(): void;
|
||
/**
|
||
* Shows or hides the device status bar (in Cordova). Requires cordova plugin add org.apache.cordova.statusbar
|
||
*/
|
||
showStatusBar(shouldShow: boolean): void;
|
||
/**
|
||
* Sets whether the app is fullscreen or not (in Cordova).
|
||
*/
|
||
fullScreen(showFullScreen?: boolean, showStatusBar?: boolean): void;
|
||
/**
|
||
* Whether the device is ready.
|
||
*/
|
||
isReady: boolean;
|
||
/**
|
||
* Whether the device is fullscreen.
|
||
*/
|
||
isFullScreen: boolean;
|
||
/**
|
||
* An array of all platforms found.
|
||
*/
|
||
platforms: Array<string>;
|
||
/**
|
||
* What grade the current platform is.
|
||
*/
|
||
grade: string;
|
||
};
|
||
}
|
||
|
||
declare var ionic: IonicStatic;
|
||
|
||
declare module 'ionic' {
|
||
export = ionic;
|
||
}
|
||
|
||
declare namespace ionic {
|
||
namespace actionSheet {
|
||
interface IonicActionSheetService {
|
||
show(options: IonicActionSheetOptions): ()=>void;
|
||
}
|
||
interface IonicActionSheetButton {
|
||
text: string;
|
||
}
|
||
interface IonicActionSheetOptions {
|
||
buttons?: Array<IonicActionSheetButton>;
|
||
titleText?: string;
|
||
cancelText?: string;
|
||
destructiveText?: string;
|
||
cancel?: ()=>any;
|
||
buttonClicked?: (index: number)=>boolean;
|
||
destructiveButtonClicked?: ()=>boolean;
|
||
cancelOnStateChange?: boolean;
|
||
cssClass?: string;
|
||
}
|
||
}
|
||
namespace backdrop {
|
||
interface IonicBackdropService {
|
||
retain(): void;
|
||
release(): void;
|
||
}
|
||
}
|
||
namespace gestures {
|
||
interface IonicGestureService {
|
||
on(eventType: string, callback: (e: any)=>any, $element: angular.IAugmentedJQuery, options: any): IonicGesture;
|
||
off(gesture: IonicGesture, eventType: string, callback: (e: any)=>any): void;
|
||
}
|
||
|
||
interface IonicGesture {
|
||
element: Element;
|
||
enabled: boolean;
|
||
options: {stop_browser_behavior: string };
|
||
on(gesture: string, handler: Function): IonicGesture;
|
||
off(gesture: string, handler: Function): IonicGesture;
|
||
trigger(gesture: string, eventData: any): IonicGesture;
|
||
enable(state: boolean): IonicGesture;
|
||
}
|
||
|
||
}
|
||
namespace list {
|
||
interface IonicListDelegate {
|
||
showReorder(showReorder?: boolean): boolean;
|
||
showDelete(showDelete?: boolean): boolean;
|
||
canSwipeItems(canSwipeItems?: boolean): boolean;
|
||
closeOptionButtons(): void;
|
||
$getByHandle(handle: string): IonicListDelegate;
|
||
}
|
||
}
|
||
namespace loading {
|
||
interface IonicLoadingService {
|
||
show(opts?: IonicLoadingOptions): void;
|
||
hide(): void;
|
||
}
|
||
interface IonicLoadingOptions {
|
||
template?: string;
|
||
templateUrl?: string;
|
||
scope?: any;
|
||
noBackdrop?: boolean;
|
||
hideOnStateChange?: boolean;
|
||
delay?: number;
|
||
duration?: number;
|
||
}
|
||
}
|
||
namespace modal {
|
||
interface IonicModalService {
|
||
fromTemplate(templateString: string, options?: IonicModalOptions): IonicModalController;
|
||
fromTemplateUrl(templateUrl: string, options?: IonicModalOptions): angular.IPromise<IonicModalController>;
|
||
}
|
||
|
||
interface IonicModalController {
|
||
initialize(options: IonicModalOptions): void;
|
||
show(): angular.IPromise<void>;
|
||
hide(): angular.IPromise<void>;
|
||
remove(): angular.IPromise<void>;
|
||
isShown(): boolean;
|
||
}
|
||
|
||
interface IonicModalOptions {
|
||
scope?: any;
|
||
animation?: string;
|
||
focusFirstInput?: boolean;
|
||
backdropClickToClose?: boolean;
|
||
hardwareBackButtonClose?: boolean;
|
||
}
|
||
}
|
||
namespace navigation {
|
||
interface IonicNavBarDelegate {
|
||
align(direction?: string): void;
|
||
showBackButton(show?: boolean): boolean;
|
||
showBar(show?: boolean): boolean;
|
||
title(title: string): void;
|
||
}
|
||
|
||
interface IonicHistoryService {
|
||
viewHistory(): any;
|
||
|
||
currentView(): any;
|
||
currentHistoryId(): string;
|
||
currentTitle(val?: string): string;
|
||
|
||
backView(): any;
|
||
backTitle(): string;
|
||
|
||
forwardView(): any;
|
||
|
||
currentStateName(): string;
|
||
|
||
goBack(backCount?: number): void;
|
||
removeBackView(): void;
|
||
clearHistory(): void;
|
||
clearCache(): angular.IPromise<any>;
|
||
nextViewOptions(options: IonicHistoryNextViewOptions): void;
|
||
}
|
||
interface IonicHistoryNextViewOptions {
|
||
disableAnimate?: boolean;
|
||
disableBack?: boolean;
|
||
historyRoot?: boolean;
|
||
}
|
||
}
|
||
namespace platform {
|
||
interface IonicPlatformService {
|
||
onHardwareBackButton(callback: Function): void;
|
||
offHardwareBackButton(callback: Function): void;
|
||
registerBackButtonAction(callback: Function, priority: number, actionId?: any): Function;
|
||
on(type: string, callback: Function): Function;
|
||
ready(callback?: Function): angular.IPromise<any>;
|
||
}
|
||
}
|
||
namespace popover {
|
||
interface IonicPopoverService {
|
||
fromTemplate(templateString: string, options: IonicPopoverOptions): IonicPopoverController;
|
||
fromTemplateUrl(templateUrl: string, options: IonicPopoverOptions): angular.IPromise<IonicPopoverController>;
|
||
}
|
||
interface IonicPopoverController {
|
||
initialize(options: IonicPopoverOptions): void;
|
||
show($event?: any): angular.IPromise<any>;
|
||
hide(): angular.IPromise<any>;
|
||
isShown(): boolean;
|
||
remove(): angular.IPromise<any>;
|
||
}
|
||
interface IonicPopoverOptions {
|
||
scope?: any;
|
||
focusFirstInput?: boolean;
|
||
backdropClickToClose?: boolean;
|
||
hardwareBackButtonClose?: boolean;
|
||
}
|
||
}
|
||
namespace popup {
|
||
interface IonicPopupService {
|
||
show(options: IonicPopupFullOptions): IonicPopupPromise;
|
||
alert(options: IonicPopupAlertOptions): IonicPopupPromise;
|
||
confirm(options: IonicPopupConfirmOptions): IonicPopupConfirmPromise;
|
||
prompt(options: IonicPopupPromptOptions): IonicPopupPromise;
|
||
}
|
||
|
||
interface IonicPopupConfirmPromise extends angular.IPromise<boolean> {
|
||
close(value?: boolean): void;
|
||
}
|
||
interface IonicPopupPromise extends angular.IPromise<any> {
|
||
close(value?: any): any;
|
||
}
|
||
interface IonicPopupBaseOptions {
|
||
title?: string;
|
||
cssClass?: string;
|
||
subTitle?: string;
|
||
template?: string;
|
||
templateUrl?: string;
|
||
}
|
||
interface IonicPopupFullOptions extends IonicPopupBaseOptions {
|
||
scope?: any;
|
||
buttons?: Array<IonicPopupButton>;
|
||
}
|
||
interface IonicPopupButton {
|
||
text: string;
|
||
type?: string;
|
||
onTap?(event?: any): void;
|
||
}
|
||
interface IonicPopupAlertOptions extends IonicPopupBaseOptions {
|
||
okText?: string;
|
||
okType?: string;
|
||
}
|
||
interface IonicPopupConfirmOptions extends IonicPopupBaseOptions {
|
||
cancelText?: string;
|
||
cancelType?: string;
|
||
okText?: string;
|
||
okType?: string;
|
||
}
|
||
interface IonicPopupPromptOptions extends IonicPopupBaseOptions {
|
||
inputType?: string;
|
||
inputPlaceholder?: string;
|
||
cancelText?: string;
|
||
cancelType?: string;
|
||
okText?: string;
|
||
okType?: string;
|
||
}
|
||
}
|
||
namespace scroll {
|
||
interface IonicScrollDelegate {
|
||
resize(): void;
|
||
scrollTop(shouldAnimate?: boolean): void;
|
||
scrollBottom(shouldAnimate?: boolean): void;
|
||
scrollTo(left: number, top: number, shouldAnimate?: boolean): void;
|
||
scrollBy(left: number, top: number, shouldAnimate?: boolean): void;
|
||
zoomTo(level: number, animate?: boolean, originLeft?: number, originTop?: number): void;
|
||
zoomBy(factor: number, animate?: boolean, originLeft?: number, originTop?: number): void;
|
||
getScrollPosition(): {left: number; top: number};
|
||
anchorScroll(shouldAnimate?: boolean): void;
|
||
freezeScroll(shouldFreeze?: boolean): boolean;
|
||
freezeAllScrolls(shouldFreeze?: boolean): boolean;
|
||
getScrollView(): any;
|
||
$getByHandle(handle: string): IonicScrollDelegate;
|
||
}
|
||
}
|
||
namespace sideMenu {
|
||
interface IonicSideMenuDelegate {
|
||
toggleLeft(isOpen?: boolean): void;
|
||
toggleRight(isOpen?: boolean): void;
|
||
getOpenRatio(): number;
|
||
isOpen(): boolean;
|
||
isOpenLeft(): boolean;
|
||
isOpenRight(): boolean;
|
||
canDragContent(canDrag?: boolean): boolean;
|
||
edgeDragThreshold(value?: boolean|number): boolean;
|
||
$getByHandle(handle: string): IonicSideMenuDelegate;
|
||
}
|
||
}
|
||
namespace slideBox {
|
||
interface IonicSlideBoxDelegate {
|
||
update(): void;
|
||
slide(to: number, speed?: number): void;
|
||
enableSlide(shouldEnable?: boolean): boolean;
|
||
previous(speed?: number): void;
|
||
next(speed?: number): void;
|
||
stop(): void;
|
||
start(): void;
|
||
currentIndex(): number;
|
||
slidesCount(): number;
|
||
$getByHandle(handle: string): IonicSlideBoxDelegate;
|
||
}
|
||
}
|
||
namespace tabs {
|
||
interface IonicTabsDelegate {
|
||
select(index: number): void;
|
||
selectedIndex(): number;
|
||
$getByHandle(handle: string): IonicTabsDelegate;
|
||
showBar(show?: boolean): boolean;
|
||
}
|
||
}
|
||
namespace utility {
|
||
interface IonicConfigProvider {
|
||
views: {
|
||
transition(transition?: string): string;
|
||
maxCache(maxNumber?: number): number;
|
||
forwardCache(value?: boolean): boolean;
|
||
swipeBackEnabled(value?: boolean): boolean;
|
||
};
|
||
scrolling: {
|
||
jsScrolling(value?: boolean): boolean;
|
||
};
|
||
backButton: {
|
||
icon(value?: string): string;
|
||
text(value?: string): string;
|
||
previousTitleText(value?: boolean): boolean;
|
||
};
|
||
form: {
|
||
checkbox(value?: string): string;
|
||
toggle(value?: string): string;
|
||
};
|
||
spinner: {
|
||
icon(value?: string): string;
|
||
};
|
||
tabs: {
|
||
style(value?: string): string;
|
||
position(value?: string): string;
|
||
};
|
||
templates: {
|
||
maxPrefetch(value?: number): number;
|
||
};
|
||
navBar: {
|
||
alignTitle(value?: string): string;
|
||
positionPrimaryButtons(value?: string): string;
|
||
positionSecondaryButtons(value?: string): string;
|
||
};
|
||
}
|
||
interface IonicPositionService {
|
||
position(element: any): {top: number; left: number; width: number; height: number};
|
||
offset(element: any): {top: number; left: number; width: number; height: number};
|
||
}
|
||
}
|
||
}
|