mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 19:59:02 +08:00
* Added missing nconf.required(keys) and Provider.required(keys) methods. * update to 4.7.0, add querycursor.map() and schema.loadClass() * add error callback for schema.post() * Added playsInline property as introduced in React 15.3.2 * Add definitions for redux-localstorage and main enhancers (#12580) * Add definitions for redux-localstorage * Add definitions for redux-localstorage-filter enhancer * Add definitions for redux-localstorage-debounce enhancer * csurf.d.ts relying on CookieOptions from express It seems express no longer exports `CookieOptions`, we need to import `express-serve-static-core` instead. * Added height property to IDialogOptions * versionKey type * kendo-ui: mark toString() params as optional (#13164) These function parameters are optional according to the upstream docs, e.g. http://docs.telerik.com/kendo-ui/api/javascript/geometry/matrix#methods-toString * Ensure that zoneAbbr and zoneName are expected type (string). * Update moment-timezone.d.ts * Fix syntax error in interact.d.ts A parameter name was missing making TypeScript compiler fail. * adding type for move to fs-extra * fixing signature of sinon/alwaysReturned based on the http://sinonjs.org/docs/#sinonspy * increasing version number * returning back the version number to the origin number * reversing changes in fs-extra * Request that PRs have meaningful titles * Improvement to existing nouislider type definition. (#12033) * updated nouislider version and added a lot of tests out of the documentation * corrected intentation * corrected untyped variables, issue raised by Travis * incorporated feedback on pull request * #13037 (#13039) * #13037 * pointToLayer first argument type fixed GeoJSON.Point to GeoJSON.Feature<GeoJSON.Point> * Missing cc in sendgrid packate (#13063) The sendgrid package was missing the `cc` field, and the `bcc` field had a too generic type (`any` instead of `string[]`, as used on the `setCcs` and `setBccs` below. * Fixes #12414 (#13076) * Fixes #12414 * Make applicationServerKey optional * added ariaLabelledBy and ariaDescribedBy to IModalSettings (#13004) * Ceymard leaflet (#13007) * replaced all overrides of LatLng by a single use of LatLngExpression when appropriate * Changed Point, PointTuple overrides to use PointExpression instead * Changet use of LatLngBounds and Bounds in general to use the Expression variant instead of having several overrides * add ElasticSeach 5.x API function for deleteByQuery (#13014) * add ElasticSeach 5.x API function for deleteByQuery * use searchParams for deleteByQuery, as theses resemble the documentation. * add DeleteByQueryParams parameter type. * add deleteByQuery to tests. * Make `less` render options optional (#13078) * Added semver * Updated gravity definition. (#13088) * Full Redis client options (#13108) * Added missing return type to on() methods. (#13082) * Update react-native.0.29.d.ts (#13118) drawerPosition is of type `number` Android DrawerConsts.DrawerPosition.Left is equivalent to DrawerLayoutAndroid.positions.Left Android DrawerConsts.DrawerPosition.Right is equivalent to DrawerLayoutAndroid.positions.Right * Upgrade to match braintree-web 3.6.1 (#13098) * Update to match braintree-web version 3.3.0 * Upgrade to match Braintree-web v3.5.0 * upgrade to match braintree-web 3.6.1 add US bank class * Fix missing parameters from svg append (#13119) * Add parameter declarations to append() * Made insertFirst parameter optional * Correct missing ‘auto’ option of GridList’s cellHeight (#13094) * Add new Angular 1.5.9 methods to $compileProvider (#13096) * Add new Angular 1.5.9 methods to $compileProvider Add new methods available in Angular 1.5.9: onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() * Add JSDoc to Angular 1.59 new methods of $compileProvider JSDoc for onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() methods. * Expand $compileProvider JSDoc Urls added to JSDoc of Angular 1.5.9 new methods . * Changed type of injectedScript property to string (#13120) The injectedScript property should take string value with script code, not the bool flag as in current version * Use unions for openlayers string enums (#13134) * Update google.maps.MapPane interface (#13122) * Removing myself (AlStar01) as definition author from angular-material.d.ts (#13125) * Clarify that notNeededPackages.json is just for packages formerly on DefinitelyTyped (#13156) * Update Parsimmon typings (#13146) * Update AmCharts.d.ts (#13170) * knex: add MySqlConnectionConfig, tests (#13161) * knex: add MySqlConnectionConfig, tests * knex: add types for MySqlConnectionConfig queryFormat params * Add note in readme about tsjs-lib-generator (#13210) * Remove redux-localstorage packages; added by #13115 instead
271 lines
9.1 KiB
TypeScript
271 lines
9.1 KiB
TypeScript
// Type definitions for ngDialog 0.6
|
|
// Project: https://github.com/likeastore/ngDialog
|
|
// Definitions by: Stephen Lautier <https://github.com/stephenlautier>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference types="angular" />
|
|
|
|
import * as angular from 'angular';
|
|
|
|
export type IDialogService = angular.dialog.IDialogService;
|
|
export type IDialogOpenResult = angular.dialog.IDialogOpenResult;
|
|
export type IDialogClosePromise = angular.dialog.IDialogClosePromise;
|
|
export type IDialogProvider = angular.dialog.IDialogProvider;
|
|
export type IDialogScope = angular.dialog.IDialogScope;
|
|
export type IDialogConfirmScope = angular.dialog.IDialogConfirmScope;
|
|
export type IDialogOptions = angular.dialog.IDialogOptions;
|
|
export type IDialogOpenOptions = angular.dialog.IDialogOpenOptions;
|
|
export type IDialogOpenConfirmOptions = angular.dialog.IDialogOpenConfirmOptions;
|
|
|
|
declare module 'angular' {
|
|
export namespace dialog {
|
|
|
|
interface IDialogService {
|
|
getDefaults(): IDialogOptions;
|
|
open(options: IDialogOpenOptions): IDialogOpenResult;
|
|
openConfirm(options: IDialogOpenConfirmOptions): IPromise<any>;
|
|
|
|
/**
|
|
* Determine whether the specified dialog is open or not.
|
|
* @param id Dialog id to check for.
|
|
* @returns {boolean} Indicating whether it exists or not.
|
|
*/
|
|
isOpen(id: string): boolean;
|
|
close(id: string, value?: any): void;
|
|
closeAll(value?: any): void;
|
|
getOpenDialogs(): string[];
|
|
}
|
|
|
|
interface IDialogOpenResult {
|
|
id: string;
|
|
close: (value?: any) => void;
|
|
closePromise: IPromise<IDialogClosePromise>;
|
|
}
|
|
|
|
interface IDialogClosePromise {
|
|
id: string;
|
|
value: any;
|
|
}
|
|
|
|
interface IDialogProvider extends angular.IServiceProvider {
|
|
/**
|
|
* Default options for the dialogs.
|
|
* @param defaultOptions
|
|
* @returns {}
|
|
*/
|
|
setDefaults(defaultOptions: IDialogOptions): void;
|
|
|
|
/**
|
|
* Adds an additional listener on every $locationChangeSuccess event and gets update version of html into dialog.
|
|
* May be useful in some rare cases when you're dependant on DOM changes, defaults to false.
|
|
* @param {boolean} force
|
|
*/
|
|
setForceHtmlReload(force: boolean) : void;
|
|
|
|
/**
|
|
* Adds additional listener on every $locationChangeSuccess event and gets updated version of body into dialog.
|
|
* Maybe useful in some rare cases when you're dependant on DOM changes, defaults to false. Use it in module's
|
|
* config as provider instance:
|
|
* @param {boolean} force
|
|
*/
|
|
setForceBodyReload(force: boolean) : void;
|
|
}
|
|
|
|
/**
|
|
* Dialog Scope which extends the $scope.
|
|
*/
|
|
interface IDialogScope extends angular.IScope {
|
|
/**
|
|
* This allows you to close dialog straight from handler in a popup element.
|
|
* @param value Any value passed to this function will be attached to the object which resolves on the close promise for this dialog.
|
|
* For dialogs opened with the openConfirm() method the value is used as the reject reason.
|
|
*/
|
|
closeThisDialog(value?: any): void;
|
|
|
|
/**
|
|
* Any serializable data that you want to be stored in the controller's dialog scope.
|
|
* From version 0.3.6 $scope.ngDialogData keeps references to the objects instead of copying them.
|
|
*/
|
|
ngDialogData : string | {} | any[];
|
|
|
|
/**
|
|
* The id of the dialog. If you you ngDialogData, it'll be also available under ngDialogData.ngDialogId
|
|
*/
|
|
ngDialogId : string;
|
|
}
|
|
|
|
interface IDialogConfirmScope extends IDialogScope {
|
|
/**
|
|
* Use this method to close the dialog and resolve the promise that was returned when opening the modal.
|
|
*
|
|
* The function accepts a single optional parameter which is used as the value of the resolved promise.
|
|
* @param {any} [value] - The value with which the promise will resolve
|
|
*/
|
|
confirm(value?:any) : void;
|
|
}
|
|
|
|
interface IDialogOptions {
|
|
/**
|
|
* This option allows you to control the dialog's look, you can use built-in themes or create your own styled modals.
|
|
* It will be appended with the "ngdialog" class e.g. className is "default-theme flat-ui" it will be class="ngdialog default-theme flat-ui".
|
|
*/
|
|
className?: string;
|
|
|
|
/**
|
|
* If true then animation for the dialog will be disabled, default false.
|
|
*/
|
|
disableAnimation?: boolean;
|
|
|
|
/**
|
|
* If false it allows to hide overlay div behind the modals, default true.
|
|
*/
|
|
overlay?: boolean;
|
|
|
|
/**
|
|
* If false it allows to hide close button on modals, default true.
|
|
*/
|
|
showClose?: boolean;
|
|
|
|
/**
|
|
* It allows to close modals by clicking Esc button, default true.
|
|
* This will close all open modals if there several of them open at the same time.
|
|
*/
|
|
closeByEscape?: boolean;
|
|
|
|
/**
|
|
* It allows to close modals by clicking on overlay background, default true. If @see Hammer.js is loaded, it will listen for tap instead of click.
|
|
*/
|
|
closeByDocument?: boolean;
|
|
|
|
/**
|
|
* Listens for $locationChangeSuccess event and closes open dialogs if true (also handles the ui.router $stateChangeSuccess event if ui.router is used)
|
|
* default : false
|
|
*/
|
|
closeByNavigation?: boolean;
|
|
|
|
/**
|
|
* If true allows to use plain string as template, default false.
|
|
*/
|
|
plain?: boolean;
|
|
|
|
/**
|
|
* Give a name for a dialog instance. It is useful for identifying specific dialog if there are multiple dialog boxes opened.
|
|
*/
|
|
name?: string | number;
|
|
|
|
/**
|
|
* Provide either the name of a function or a function to be called before the dialog is closed.
|
|
* If the callback function specified in the option returns false then the dialog will not be closed.
|
|
* Alternatively, if the callback function returns a promise that gets resolved the dialog will be closed.
|
|
*
|
|
* more: https://github.com/likeastore/ngDialog#preclosecallback-string--function
|
|
*/
|
|
preCloseCallback?: string|Function;
|
|
|
|
/**
|
|
* Pass false to disable template caching. Useful for developing purposes, default is true.
|
|
*/
|
|
cache?: boolean;
|
|
|
|
/**
|
|
* Specify your element where to append dialog instance, accepts selector string (e.g. #yourId, .yourClass).
|
|
* If not specified appends dialog to body as default behavior.
|
|
*/
|
|
appendTo?: string;
|
|
|
|
/**
|
|
* When true, ensures that the focused element remains within the dialog to conform to accessibility recommendations.
|
|
* Default value is true
|
|
*/
|
|
trapFocus?: boolean;
|
|
|
|
/**
|
|
* When true, closing the dialog restores focus to the element that launched it. Designed to improve keyboard
|
|
* accessibility. Default value is true
|
|
*/
|
|
preserveFocus?: boolean;
|
|
|
|
/**
|
|
* When true, automatically selects appropriate values for any unspecified accessibility attributes. Default value is true
|
|
*/
|
|
ariaAuto? : boolean;
|
|
|
|
/**
|
|
* Specifies the value for the role attribute that should be applied to the dialog element. Default value is null (unspecified)
|
|
*/
|
|
ariaRole?: string;
|
|
|
|
/**
|
|
* Specifies the value for the aria-labelledby attribute that should be applied to the dialog element.
|
|
* Default value is null (unspecified)
|
|
*
|
|
* If specified, the value is not validated against the DOM
|
|
*/
|
|
ariaLabelledById?: string;
|
|
|
|
/**
|
|
* Specifies the CSS selector for the element to be referenced by the aria-labelledby attribute on the dialog element. Default value is null (unspecified)
|
|
*
|
|
* If specified, the first matching element is used.
|
|
*/
|
|
ariaLabelledBySelector?: string;
|
|
|
|
/**
|
|
* Specifies the value for the aria-describedby attribute that should be applied to the dialog element. Default value is null (unspecified)
|
|
*
|
|
* If specified, the value is not validated against the DOM.
|
|
*/
|
|
ariaDescribedById?: string;
|
|
|
|
/**
|
|
* Specifies the CSS selector for the element to be referenced by the aria-describedby attribute on the dialog element. Default value is null (unspecified)
|
|
*
|
|
* If specified, the first matching element is used.
|
|
*/
|
|
ariaDescribedBySelector?: string;
|
|
|
|
/**
|
|
* Specifies the width of the dialog content element. Default value is null (unspecified)
|
|
*/
|
|
width?: string|number;
|
|
|
|
/**
|
|
* Specifies the height of the dialog content element. Default value is null (unspecified)
|
|
*/
|
|
height?: string|number;
|
|
}
|
|
|
|
/**
|
|
* Options which are provided to open a dialog.
|
|
*/
|
|
interface IDialogOpenOptions extends IDialogOptions {
|
|
template: string;
|
|
controller?: string| any[] | any;
|
|
controllerAs?: string;
|
|
bindToController?: boolean;
|
|
|
|
/**
|
|
* Scope object that will be passed to dialog. If you use controller with separate $scope service this object will be passed to $scope.$parent param.
|
|
*/
|
|
scope?: IDialogScope;
|
|
|
|
/**
|
|
* An optional map of dependencies which should be injected into the controller. If any of these dependencies
|
|
* are promises, ngDialog will wait for them all to be resolved or one to be rejected before the controller
|
|
* is instantiated.
|
|
*/
|
|
resolve?: {[key : string] : string | Function};
|
|
|
|
/**
|
|
* Any serializable data that you want to be stored in the controller's dialog scope. ($scope.ngDialogData).
|
|
* From version 0.3.6 $scope.ngDialogData keeps references to the objects instead of copying them.
|
|
*/
|
|
data?: string | {} | any[];
|
|
}
|
|
|
|
interface IDialogOpenConfirmOptions extends IDialogOpenOptions {
|
|
scope?: IDialogConfirmScope;
|
|
}
|
|
}
|
|
}
|