@serenity-is/corelib
Version:
Serenity Core Library
767 lines (766 loc) • 252 kB
TypeScript
import { Column, EventEmitter, FormatterContext, FormatterResult, Grid, GridOptions, Group, GroupItemMetadataProvider, GroupTotals } from '@serenity-is/sleekgrid';
export interface UserDefinition {
/**
* Username of the logged user
*/
Username?: string;
/**
* Display name of the logged user
*/
DisplayName?: string;
/**
* This indicates that the user is a super "admin", e.g. assumed to have all the permissions available.
* It does not mean a member of Administrators, who might not have some of the permissions */
IsAdmin?: boolean;
/**
* A hashset of permission keys that the current user have, explicitly assigned or via its
* roles. Note that client side permission checks should only be used for UI enable/disable etc.
* You should not rely on client side permission checks and always re-check permissions server side.
*/
Permissions?: {
[key: string]: boolean;
};
}
/**
* Contains permission related functions.
*
* ## Note
* We use a namespace here both for compatibility and for allowing users to override
* these functions easily in ES modules environment, which is normally hard to do.
*/
export declare namespace Authorization {
/**
* Checks if the current user has the permission specified.
* This should only be used for UI purposes and it is strongly recommended to check permissions server side.
*
* > Please prefer the `hasPermissionAsync` variant as this may block the UI thread if the `UserData` script is not already loaded.
* @param permission Permission key. It may contain logical operators like A&B|C.
* @returns `false` for "null or undefined", true for "*", `IsLoggedIn` for "?". For other permissions,
* if the user has the permission or if the user has the `IsAdmin` flag (super admin) `true`, otherwise `false`.
*/
function hasPermission(permission: string): boolean;
/**
* Checks if the current user has the permission specified.
* This should only be used for UI purposes and it is strongly recommended to check permissions server side.
*
* @param permission Permission key. It may contain logical operators like A&B|C.
* @returns `false` for "null or undefined", true for "*", `IsLoggedIn` for "?". For other permissions,
* if the user has the permission or if the user has the `IsAdmin` flag (super admin) `true`, otherwise `false`.
*/
function hasPermissionAsync(permission: string): Promise<boolean>;
/**
* Checks if the hashset contains the specified permission, also handling logical "|" and "&" operators
* @param permissionSet Set of permissions
* @param permission Permission key or a permission expression containing & | operators
* @returns true if set contains permission
*/
function isPermissionInSet(permissionSet: {
[key: string]: boolean;
}, permission: string): boolean;
/**
* Throws an error if the current user does not have the specified permission.
* Prefer `await validatePermissionAsync()` as this one might block the UI if the `UserData`
* is not already loaded.
* @param permission Permission key. It may contain logical operators like A&B|C.
*/
function validatePermission(permission: string): void;
/**
* Throws an error if the current user does not have the specified permission.
* @param permission Permission key. It may contain logical operators like A&B|C.
* @example
* await Authorization.validatePermissionAsync("A&B|C");
*/
function validatePermissionAsync(permission: string): Promise<void>;
}
export declare namespace Authorization {
/**
* Checks if the current user is logged in. Prefer `isLoggedInAsync` as this one might block the UI if the `UserData`
* is not already loaded.
* @returns `true` if the user is logged in, `false` otherwise.
* @example
* if (Authorization.isLoggedIn) {
* // do something
* }
*/
let isLoggedIn: boolean;
/**
* Checks if the current user is logged in.
* @returns `true` if the user is logged in, `false` otherwise.
* @example
* if (await Authorization.isLoggedInAsync) {
* // do something
* }
*/
let isLoggedInAsync: Promise<boolean>;
/** Returns the username for currently logged user. Prefer `usernameAsync` as this one might block the UI if the `UserData`
* is not already loaded.
* @returns Username for currently logged user.
* @example
* if (Authorization.username) {
* // do something
* }
*/
let username: string;
/** Returns the username for currently logged user.
* @returns Username for currently logged user.
* @example
* if (await Authorization.usernameAsync) {
* // do something
* }
*/
let usernameAsync: Promise<string>;
/** Returns the user data for currently logged user. Prefer `userDefinitionAsync` as this one might block the UI if the `UserData`
* is not already loaded.
* @returns User data for currently logged user.
* @example
* if (Authorization.userDefinition.IsAdmin) {
* // do something
* }
*/
let userDefinition: UserDefinition;
/** Returns the user data for currently logged user.
* @returns User data for currently logged user.
* @example
* if ((await Authorization.userDefinitionAsync).IsAdmin) {
* // do something
* }
*/
let userDefinitionAsync: Promise<UserDefinition>;
}
/**
* Tries to block the page
*/
export declare function blockUI(options?: {
zIndex?: number;
useTimeout?: boolean;
}): void;
/**
* Unblocks the page.
*/
export declare function blockUndo(): void;
export declare const Config: {
/**
* This is the root path of your application. If your application resides under http://localhost/mysite/,
* your root path is "/mysite/". This variable is automatically initialized by reading from a <link> element
* with ID "ApplicationPath" from current page, which is usually located in your _LayoutHead.cshtml file
*/
applicationPath: string;
/**
* Gets a default return URL for the application. This is used when a return URL is not specified
* @param purpose Optional purpose for the return URL, for example "login" or "logout"
*/
defaultReturnUrl: (purpose?: string) => string;
/**
* Email validation by default only allows ASCII characters. Set this to true if you want to allow unicode.
*/
emailAllowOnlyAscii: boolean;
/**
* This is an optional callback that is used to load types lazily when they are not found in the
* type registry. This is useful when a type is not available in currently loaded scripts
* (e.g. chunks / entry modules) but is available via some other means (e.g. a separate script file).
* The method may return a type or a promise that resolves to a type. If either returns null,
* the type is considered to be not found.
* The method is called with the type key and an optional kind parameter, which is used to distinguish
* between different kinds of types (e.g. "editor" or "dialog" or "enum").
*/
lazyTypeLoader: (typeKey: string, kind: "dialog" | "editor" | "enum" | "formatter" | string) => any | Promise<any>;
/**
* This is the list of root namespaces that may be searched for types. For example, if you specify an editor type
* of "MyEditor", first a class with name "MyEditor" will be searched, if not found, search will be followed by
* "Serenity.MyEditor" and "MyApp.MyEditor" if you added "MyApp" to the list of root namespaces.
*
* You should usually add your application root namespace to this list in ScriptInit(ialization).ts file.
*/
rootNamespaces: string[];
/**
* This is an optional method for handling when user is not logged in. If a users session is expired
* and when a NotAuthorized response is received from a service call, Serenity will call this handler, so
* you may intercept it and notify user about this situation and ask if she wants to login again...
*/
notLoggedInHandler: Function;
};
export declare function resetApplicationPath(): void;
/**
* CriteriaBuilder is a class that allows to build unary or binary criteria with completion support.
*/
export declare class CriteriaBuilder extends Array {
/**
* Creates a between criteria.
* @param fromInclusive from value
* @param toInclusive to value
*/
bw(fromInclusive: any, toInclusive: any): Array<any>;
/**
* Creates a contains criteria
* @param value contains value
*/
contains(value: string): Array<any>;
/**
* Creates a endsWith criteria
* @param value endsWith value
*/
endsWith(value: string): Array<any>;
/**
* Creates an equal (=) criteria
* @param value equal value
*/
eq(value: any): Array<any>;
/**
* Creates a greater than criteria
* @param value greater than value
*/
gt(value: any): Array<any>;
/**
* Creates a greater than or equal criteria
* @param value greater than or equal value
*/
ge(value: any): Array<any>;
/**
* Creates a in criteria
* @param values in values
*/
in(values: any[]): Array<any>;
/**
* Creates a IS NULL criteria
*/
isNull(): Array<any>;
/**
* Creates a IS NOT NULL criteria
*/
isNotNull(): Array<any>;
/**
* Creates a less than or equal to criteria
* @param value less than or equal to value
*/
le(value: any): Array<any>;
/**
* Creates a less than criteria
* @param value less than value
*/
lt(value: any): Array<any>;
/**
* Creates a not equal criteria
* @param value not equal value
*/
ne(value: any): Array<any>;
/**
* Creates a LIKE criteria
* @param value like value
*/
like(value: any): Array<any>;
/**
* Creates a STARTS WITH criteria
* @param value startsWith value
*/
startsWith(value: string): Array<any>;
/**
* Creates a NOT IN criteria
* @param values array of NOT IN values
*/
notIn(values: any[]): Array<any>;
/**
* Creates a NOT LIKE criteria
* @param value not like value
*/
notLike(value: any): Array<any>;
}
/**
* Parses a criteria expression to Serenity Criteria array format.
* The string may optionally contain parameters like `A >= @p1 and B < @p2`.
* @param expression The criteria expression.
* @param params The dictionary containing parameter values like { p1: 10, p2: 20 }.
* @example
* `parseCriteria('A >= @p1 and B < @p2', { p1: 5, p2: 4 }) // [[[a], '>=' 5], 'and', [[b], '<', 4]]`
*/
export declare function parseCriteria(expression: string, params?: any): any[];
/**
* Parses a criteria expression to Serenity Criteria array format.
* The expression may contain parameter placeholders like `A >= ${p1}`
* where p1 is a variable in the scope.
* @param strings The string fragments.
* @param values The tagged template arguments.
* @example
* var a = 5, b = 4;
* parseCriteria`A >= ${a} and B < ${b}` // [[[a], '>=' 5], 'and', [[b], '<', 4]]
*/
export declare function parseCriteria(strings: TemplateStringsArray, ...values: any[]): any[];
/**
* Enumeration of Criteria operator keys.
*/
export declare enum CriteriaOperator {
paren = "()",
not = "not",
isNull = "is null",
isNotNull = "is not null",
exists = "exists",
and = "and",
or = "or",
xor = "xor",
eq = "=",
ne = "!=",
gt = ">",
ge = ">=",
lt = "<",
le = "<=",
in = "in",
notIn = "not in",
like = "like",
notLike = "not like"
}
/**
* Creates a new criteria builder containg the passed field name.
* @param field The field name.
*/
export declare function Criteria(field: string): CriteriaBuilder;
export declare namespace Criteria {
var and: (c1: any[], c2: any[], ...rest: any[][]) => any[];
var Operator: typeof CriteriaOperator;
var isEmpty: (c: any[]) => boolean;
var join: (c1: any[], op: string, c2: any[]) => any[];
var not: (c: any[]) => (string | any[])[];
var or: (c1: any[], c2: any[], ...rest: any[][]) => any[];
var paren: (c: any[]) => any[];
var parse: typeof parseCriteria;
}
export interface DebouncedFunction<T extends (...args: any[]) => any> {
/**
* Call the original function, but applying the debounce rules.
*
* If the debounced function can be run immediately, this calls it and returns its return
* value.
*
* Otherwise, it returns the return value of the last invocation, or undefined if the debounced
* function was not invoked yet.
*/
(...args: Parameters<T>): ReturnType<T> | undefined;
/**
* Throw away any pending invocation of the debounced function.
*/
clear(): void;
/**
* If there is a pending invocation of the debounced function, invoke it immediately and return
* its return value.
*
* Otherwise, return the value from the last invocation, or undefined if the debounced function
* was never invoked.
*/
flush(): ReturnType<T> | undefined;
}
/**
* Returns a function, that, as long as it continues to be invoked, will not
* be triggered. The function also has a property 'clear' that can be used
* to clear the timer to prevent previously scheduled executions, and flush method
* to invoke scheduled executions now if any.
* @param wait The function will be called after it stops being called for
* N milliseconds.
* @param immediate If passed, trigger the function on the leading edge, instead of the trailing.
*
*/
export declare function debounce<T extends (...args: any) => any>(func: T, wait?: number, immediate?: boolean): DebouncedFunction<T>;
/**
* Represents the utility color options for icons corresponding to Bootstrap contextual colors like primary, secondary, success etc.
*/
export type UtilityColor = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "muted" | "white";
/**
* Represents the type of text color.
* It can be one of the predefined UtilityColor values or one of the following CSS color names:
* "aqua", "blue", "fuschia", "gray", "green", "light-blue", "lime", "maroon", "navy", "olive", "orange", "purple", "red", "teal", "yellow".
*/
export type TextColor = UtilityColor | "aqua" | "blue" | "fuschia" | "gray" | "green" | "light-blue" | "lime" | "maroon" | "navy" | "olive" | "orange" | "purple" | "red" | "teal" | "yellow";
/**
* Returns the CSS class name for the background color based on the provided UtilityColor.
* @param color - The UtilityColor to generate the CSS class name for.
* @returns The CSS class name for the background color.
*/
export declare function bgColor(color: UtilityColor): string;
/**
* Returns the CSS class for the specified text color.
* @param color - The text color.
* @returns The CSS class for the specified text color.
*/
export declare function textColor(color: TextColor): string;
/**
* Returns the CSS class for a Font Awesome icon.
* @param key - The key of the Font Awesome icon.
* @param color - The optional color of the icon.
* @returns The CSS class for the icon.
*/
export declare function faIcon(key: faIconKey, color?: TextColor): string;
/**
* Generates a fully qualified class name for a Font Awesome brand icon.
* @param key - The key of the Font Awesome brand icon.
* @param color - The optional color of the icon.
* @returns The fully qualified class name for the icon.
*/
export declare function fabIcon(key: fabIconKey, color?: TextColor): string;
/**
* Represents a known icon class.
* The icon class can be either a Font Awesome icon (`fa fa-${faIconKey}`)
* or a Font Awesome Brands icon (`fab fa-${fabIconKey}`).
*/
export type KnownIconClass = `fa fa-${faIconKey}` | `fab fa-${fabIconKey}`;
/**
* Represents a type that can be either a known icon class or a string.
*/
export type AnyIconClass = KnownIconClass | (string & {});
/**
* Represents the type for an icon class name.
* It can be either a single icon class or an array of icon classes.
*/
export type IconClassName = AnyIconClass | (AnyIconClass[]);
/**
* Returns the CSS class name for the given icon.
* @param icon The icon class name or an array of class names.
* @returns The CSS class name for the icon.
*/
export declare function iconClassName(icon: IconClassName): string;
export type faIconKey = "ad" | "address-book" | "address-card" | "adjust" | "air-freshener" | "align-center" | "align-justify" | "align-left" | "align-right" | "allergies" | "ambulance" | "american-sign-language-interpreting" | "anchor" | "angle-double-down" | "angle-double-left" | "angle-double-right" | "angle-double-up" | "angle-down" | "angle-left" | "angle-right" | "angle-up" | "angry" | "ankh" | "apple-alt" | "archive" | "archway" | "arrow-alt-circle-down" | "arrow-alt-circle-left" | "arrow-alt-circle-right" | "arrow-alt-circle-up" | "arrow-circle-down" | "arrow-circle-left" | "arrow-circle-right" | "arrow-circle-up" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "arrows-alt" | "arrows-alt-h" | "arrows-alt-v" | "assistive-listening-systems" | "asterisk" | "at" | "atlas" | "atom" | "audio-description" | "award" | "baby" | "baby-carriage" | "backspace" | "backward" | "bacon" | "balance-scale" | "balance-scale-left" | "balance-scale-right" | "ban" | "band-aid" | "barcode" | "bars" | "baseball-ball" | "basketball-ball" | "bath" | "battery-empty" | "battery-full" | "battery-half" | "battery-quarter" | "battery-three-quarters" | "bed" | "beer" | "bell" | "bell-o" | "bell-slash" | "bezier-curve" | "bible" | "bicycle" | "biking" | "binoculars" | "biohazard" | "birthday-cake" | "blender" | "blender-phone" | "blind" | "blog" | "bold" | "bolt" | "bomb" | "bone" | "bong" | "book" | "book-dead" | "book-medical" | "book-open" | "book-reader" | "bookmark" | "border-all" | "border-none" | "border-style" | "bowling-ball" | "box" | "box-open" | "boxes" | "braille" | "brain" | "bread-slice" | "briefcase" | "briefcase-medical" | "broadcast-tower" | "broom" | "brush" | "bug" | "building" | "bullhorn" | "bullseye" | "burn" | "bus" | "bus-alt" | "business-time" | "calculator" | "calendar" | "calendar-alt" | "calendar-check" | "calendar-day" | "calendar-minus" | "calendar-plus" | "calendar-times" | "calendar-week" | "camera" | "camera-retro" | "campground" | "candy-cane" | "cannabis" | "capsules" | "car" | "car-alt" | "car-battery" | "car-crash" | "car-side" | "caret-down" | "caret-left" | "caret-right" | "caret-square-down" | "caret-square-left" | "caret-square-right" | "caret-square-up" | "caret-up" | "carrot" | "cart-arrow-down" | "cart-plus" | "cash-register" | "cat" | "certificate" | "chair" | "chalkboard" | "chalkboard-teacher" | "charging-station" | "chart-area" | "chart-bar" | "chart-line" | "chart-pie" | "check" | "check-circle" | "check-double" | "check-square" | "cheese" | "chess" | "chess-bishop" | "chess-board" | "chess-king" | "chess-knight" | "chess-pawn" | "chess-queen" | "chess-rook" | "chevron-circle-down" | "chevron-circle-left" | "chevron-circle-right" | "chevron-circle-up" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "child" | "church" | "circle" | "circle-notch" | "city" | "clinic-medical" | "clipboard" | "clipboard-check" | "clipboard-list" | "clock" | "clock-o" | "clone" | "closed-captioning" | "cloud" | "cloud-download-alt" | "cloud-meatball" | "cloud-moon" | "cloud-moon-rain" | "cloud-rain" | "cloud-showers-heavy" | "cloud-sun" | "cloud-sun-rain" | "cloud-upload-alt" | "cocktail" | "code" | "code-branch" | "coffee" | "cog" | "cogs" | "coins" | "columns" | "comment" | "comment-alt" | "comment-dollar" | "comment-dots" | "comment-medical" | "comment-slash" | "comments" | "comments-dollar" | "compact-disc" | "compass" | "compress" | "compress-arrows-alt" | "concierge-bell" | "cookie" | "cookie-bite" | "copy" | "copyright" | "couch" | "credit-card" | "crop" | "crop-alt" | "cross" | "crosshairs" | "crow" | "crown" | "crutch" | "cube" | "cubes" | "cut" | "database" | "deaf" | "democrat" | "desktop" | "dharmachakra" | "diagnoses" | "dice" | "dice-d20" | "dice-d6" | "dice-five" | "dice-four" | "dice-one" | "dice-six" | "dice-three" | "dice-two" | "digital-tachograph" | "directions" | "divide" | "dizzy" | "dna" | "dog" | "dollar-sign" | "dolly" | "dolly-flatbed" | "donate" | "door-closed" | "door-open" | "dot-circle" | "dove" | "download" | "drafting-compass" | "dragon" | "draw-polygon" | "drum" | "drum-steelpan" | "drumstick-bite" | "dumbbell" | "dumpster" | "dumpster-fire" | "dungeon" | "edit" | "egg" | "eject" | "ellipsis-h" | "ellipsis-v" | "envelope" | "envelope-o" | "envelope-open" | "envelope-open-text" | "envelope-square" | "equals" | "eraser" | "ethernet" | "euro-sign" | "exchange-alt" | "exclamation" | "exclamation-circle" | "exclamation-triangle" | "expand" | "expand-arrows-alt" | "external-link-alt" | "external-link-square-alt" | "eye" | "eye-dropper" | "eye-slash" | "fan" | "fast-backward" | "fast-forward" | "fax" | "feather" | "feather-alt" | "female" | "fighter-jet" | "file" | "file-alt" | "file-archive" | "file-audio" | "file-code" | "file-contract" | "file-csv" | "file-download" | "file-excel" | "file-excel-o" | "file-export" | "file-image" | "file-import" | "file-invoice" | "file-invoice-dollar" | "file-medical" | "file-medical-alt" | "file-pdf" | "file-pdf-o" | "file-powerpoint" | "file-prescription" | "file-signature" | "file-upload" | "file-text" | "file-text-o" | "file-video" | "file-word" | "fill" | "fill-drip" | "film" | "filter" | "fingerprint" | "fire" | "floppy-o" | "fire-alt" | "fire-extinguisher" | "first-aid" | "fish" | "fist-raised" | "flag" | "flag-checkered" | "flag-usa" | "flask" | "flushed" | "folder" | "folder-minus" | "folder-open" | "folder-open-o" | "folder-plus" | "font" | "football-ball" | "forward" | "frog" | "frown" | "frown-open" | "funnel-dollar" | "futbol" | "gamepad" | "gas-pump" | "gavel" | "gem" | "genderless" | "ghost" | "gift" | "gifts" | "glass-cheers" | "glass-martini" | "glass-martini-alt" | "glass-whiskey" | "glasses" | "globe" | "globe-africa" | "globe-americas" | "globe-asia" | "globe-europe" | "golf-ball" | "gopuram" | "graduation-cap" | "greater-than" | "greater-than-equal" | "grimace" | "grin" | "grin-alt" | "grin-beam" | "grin-beam-sweat" | "grin-hearts" | "grin-squint" | "grin-squint-tears" | "grin-stars" | "grin-tears" | "grin-tongue" | "grin-tongue-squint" | "grin-tongue-wink" | "grin-wink" | "grip-horizontal" | "grip-lines" | "grip-lines-vertical" | "grip-vertical" | "guitar" | "h-square" | "hamburger" | "hammer" | "hamsa" | "hand-holding" | "hand-holding-heart" | "hand-holding-usd" | "hand-lizard" | "hand-middle-finger" | "hand-paper" | "hand-peace" | "hand-point-down" | "hand-point-left" | "hand-point-right" | "hand-point-up" | "hand-pointer" | "hand-rock" | "hand-scissors" | "hand-spock" | "hands" | "hands-helping" | "handshake" | "hanukiah" | "hard-hat" | "hashtag" | "hat-cowboy" | "hat-cowboy-side" | "hat-wizard" | "haykal" | "hdd" | "heading" | "headphones" | "headphones-alt" | "headset" | "heart" | "heart-broken" | "heartbeat" | "helicopter" | "highlighter" | "hiking" | "hippo" | "history" | "hockey-puck" | "holly-berry" | "home" | "horse" | "horse-head" | "hospital" | "hospital-alt" | "hospital-symbol" | "hot-tub" | "hotdog" | "hotel" | "hourglass" | "hourglass-end" | "hourglass-half" | "hourglass-start" | "house-damage" | "hryvnia" | "i-cursor" | "ice-cream" | "icicles" | "icons" | "id-badge" | "id-card" | "id-card-alt" | "igloo" | "image" | "images" | "inbox" | "indent" | "industry" | "infinity" | "info" | "info-circle" | "italic" | "jedi" | "joint" | "journal-whills" | "kaaba" | "key" | "keyboard" | "khanda" | "kiss" | "kiss-beam" | "kiss-wink-heart" | "kiwi-bird" | "landmark" | "language" | "laptop" | "laptop-code" | "laptop-medical" | "laugh" | "laugh-beam" | "laugh-squint" | "laugh-wink" | "layer-group" | "leaf" | "lemon" | "less-than" | "less-than-equal" | "level-down-alt" | "level-up-alt" | "life-ring" | "lightbulb" | "link" | "lira-sign" | "list" | "list-alt" | "list-ol" | "list-ul" | "location-arrow" | "lock" | "lock-open" | "long-arrow-alt-down" | "long-arrow-alt-left" | "long-arrow-alt-right" | "long-arrow-alt-up" | "low-vision" | "luggage-cart" | "magic" | "magnet" | "mail-bulk" | "mail-forward" | "mail-reply" | "male" | "map" | "map-marked" | "map-marked-alt" | "map-marker" | "map-marker-alt" | "map-pin" | "map-signs" | "marker" | "mars" | "mars-double" | "mars-stroke" | "mars-stroke-h" | "mars-stroke-v" | "mask" | "medal" | "medkit" | "meh" | "meh-blank" | "meh-rolling-eyes" | "memory" | "menorah" | "mercury" | "meteor" | "microchip" | "microphone" | "microphone-alt" | "microphone-alt-slash" | "microphone-slash" | "microscope" | "minus" | "minus-circle" | "minus-square" | "mitten" | "mobile" | "mobile-alt" | "money-bill" | "money-bill-alt" | "money-bill-wave" | "money-bill-wave-alt" | "money-check" | "money-check-alt" | "monument" | "moon" | "mortar-pestle" | "mosque" | "motorcycle" | "mountain" | "mouse" | "mouse-pointer" | "mug-hot" | "music" | "network-wired" | "neuter" | "newspaper" | "not-equal" | "notes-medical" | "object-group" | "object-ungroup" | "oil-can" | "om" | "otter" | "outdent" | "pager" | "paint-brush" | "paint-roller" | "palette" | "pallet" | "paper-plane" | "paperclip" | "parachute-box" | "paragraph" | "parking" | "passport" | "pastafarianism" | "paste" | "pause" | "pause-circle" | "paw" | "peace" | "pen" | "pen-alt" | "pen-fancy" | "pen-nib" | "pen-square" | "pencil-alt" | "pencil-ruler" | "pencil-square-o" | "people-carry" | "pepper-hot" | "percent" | "percentage" | "person-booth" | "phone" | "phone-alt" | "phone-slash" | "phone-square" | "phone-square-alt" | "phone-volume" | "photo-video" | "piggy-bank" | "pills" | "pizza-slice" | "place-of-worship" | "plane" | "plane-arrival" | "plane-departure" | "play" | "play-circle" | "plug" | "plus" | "plus-circle" | "plus-square" | "podcast" | "poll" | "poll-h" | "poo" | "poo-storm" | "poop" | "portrait" | "pound-sign" | "power-off" | "pray" | "praying-hands" | "prescription" | "prescription-bottle" | "prescription-bottle-alt" | "print" | "procedures" | "project-diagram" | "puzzle-piece" | "qrcode" | "question" | "question-circle" | "quidditch" | "quote-left" | "quote-right" | "quran" | "radiation" | "radiation-alt" | "rainbow" | "random" | "receipt" | "record-vinyl" | "recycle" | "redo" | "refresh" | "redo-alt" | "registered" | "remove-format" | "reply" | "reply-all" | "republican" | "restroom" | "retweet" | "ribbon" | "ring" | "road" | "robot" | "rocket" | "route" | "rss" | "rss-square" | "ruble-sign" | "ruler" | "ruler-combined" | "ruler-horizontal" | "ruler-vertical" | "running" | "rupee-sign" | "sad-cry" | "sad-tear" | "satellite" | "satellite-dish" | "save" | "school" | "screwdriver" | "scroll" | "sd-card" | "search" | "search-dollar" | "search-location" | "search-minus" | "search-plus" | "seedling" | "server" | "shapes" | "share" | "share-alt" | "share-alt-square" | "share-square" | "shekel-sign" | "shield-alt" | "ship" | "shipping-fast" | "shoe-prints" | "shopping-bag" | "shopping-basket" | "shopping-cart" | "shower" | "shuttle-van" | "sign" | "sign-in-alt" | "sign-language" | "sign-out" | "sign-out-alt" | "signal" | "signature" | "sim-card" | "sitemap" | "skating" | "skiing" | "skiing-nordic" | "skull" | "skull-crossbones" | "slash" | "sleigh" | "sliders-h" | "smile" | "smile-beam" | "smile-wink" | "smog" | "smoking" | "smoking-ban" | "sms" | "snowboarding" | "snowflake" | "snowman" | "snowplow" | "socks" | "solar-panel" | "sort" | "sort-alpha-down" | "sort-alpha-down-alt" | "sort-alpha-up" | "sort-alpha-up-alt" | "sort-amount-down" | "sort-amount-down-alt" | "sort-amount-up" | "sort-amount-up-alt" | "sort-down" | "sort-numeric-down" | "sort-numeric-down-alt" | "sort-numeric-up" | "sort-numeric-up-alt" | "sort-up" | "spa" | "space-shuttle" | "spell-check" | "spider" | "spinner" | "splotch" | "spray-can" | "square" | "square-full" | "square-root-alt" | "stamp" | "star" | "star-and-crescent" | "star-half" | "star-half-alt" | "star-o" | "star-of-david" | "star-of-life" | "step-backward" | "step-forward" | "stethoscope" | "sticky-note" | "stop" | "stop-circle" | "stopwatch" | "store" | "store-alt" | "stream" | "street-view" | "strikethrough" | "stroopwafel" | "subscript" | "subway" | "suitcase" | "suitcase-rolling" | "sun" | "superscript" | "surprise" | "swatchbook" | "swimmer" | "swimming-pool" | "synagogue" | "sync" | "sync-alt" | "syringe" | "table" | "table-tennis" | "tablet" | "tablet-alt" | "tablets" | "tachometer-alt" | "tag" | "tags" | "tape" | "tasks" | "taxi" | "teeth" | "teeth-open" | "temperature-high" | "temperature-low" | "tenge" | "terminal" | "text-height" | "text-width" | "th" | "th-large" | "th-list" | "theater-masks" | "thermometer" | "thermometer-empty" | "thermometer-full" | "thermometer-half" | "thermometer-quarter" | "thermometer-three-quarters" | "thumbs-down" | "thumbs-up" | "thumbtack" | "ticket-alt" | "times" | "times-circle" | "tint" | "tint-slash" | "tired" | "toggle-off" | "toggle-on" | "toilet" | "toilet-paper" | "toolbox" | "tools" | "tooth" | "torah" | "torii-gate" | "tractor" | "trademark" | "traffic-light" | "train" | "tram" | "transgender" | "transgender-alt" | "trash" | "trash-alt" | "trash-o" | "trash-restore" | "trash-restore-alt" | "tree" | "trophy" | "truck" | "truck-loading" | "truck-monster" | "truck-moving" | "truck-pickup" | "tshirt" | "tty" | "tv" | "umbrella" | "umbrella-beach" | "underline" | "undo" | "undo-alt" | "universal-access" | "university" | "unlink" | "unlock" | "unlock-alt" | "upload" | "user" | "user-alt" | "user-alt-slash" | "user-astronaut" | "user-check" | "user-circle" | "user-clock" | "user-cog" | "user-edit" | "user-friends" | "user-graduate" | "user-injured" | "user-lock" | "user-md" | "user-minus" | "user-ninja" | "user-nurse" | "user-plus" | "user-secret" | "user-shield" | "user-slash" | "user-tag" | "user-tie" | "user-times" | "users" | "users-cog" | "utensil-spoon" | "utensils" | "vector-square" | "venus" | "venus-double" | "venus-mars" | "vial" | "vials" | "video" | "video-slash" | "vihara" | "voicemail" | "volleyball-ball" | "volume-down" | "volume-mute" | "volume-off" | "volume-up" | "vote-yea" | "vr-cardboard" | "walking" | "wallet" | "warehouse" | "water" | "wave-square" | "weight" | "weight-hanging" | "wheelchair" | "wifi" | "wind" | "window-close" | "window-maximize" | "window-minimize" | "window-restore" | "wine-bottle" | "wine-glass" | "wine-glass-alt" | "won-sign" | "wrench" | "x-ray" | "yen-sign" | "yin-yang";
export type fabIconKey = "500px" | "accessible-icon" | "accusoft" | "acquisitions-incorporated" | "adn" | "adobe" | "adversal" | "affiliatetheme" | "airbnb" | "algolia" | "alipay" | "amazon" | "amazon-pay" | "amilia" | "android" | "angellist" | "angrycreative" | "angular" | "app-store" | "app-store-ios" | "apper" | "apple" | "apple-pay" | "artstation" | "asymmetrik" | "atlassian" | "audible" | "autoprefixer" | "avianex" | "aviato" | "aws" | "bandcamp" | "battle-net" | "behance" | "behance-square" | "bimobject" | "bitbucket" | "bitcoin" | "bity" | "black-tie" | "blackberry" | "blogger" | "blogger-b" | "bluetooth" | "bluetooth-b" | "bootstrap" | "btc" | "buffer" | "buromobelexperte" | "buy-n-large" | "buysellads" | "canadian-maple-leaf" | "cc-amazon-pay" | "cc-amex" | "cc-apple-pay" | "cc-diners-club" | "cc-discover" | "cc-jcb" | "cc-mastercard" | "cc-paypal" | "cc-stripe" | "cc-visa" | "centercode" | "centos" | "chrome" | "chromecast" | "cloudscale" | "cloudsmith" | "cloudversify" | "codepen" | "codiepie" | "confluence" | "connectdevelop" | "contao" | "cotton-bureau" | "cpanel" | "creative-commons" | "creative-commons-by" | "creative-commons-nc" | "creative-commons-nc-eu" | "creative-commons-nc-jp" | "creative-commons-nd" | "creative-commons-pd" | "creative-commons-pd-alt" | "creative-commons-remix" | "creative-commons-sa" | "creative-commons-sampling" | "creative-commons-sampling-plus" | "creative-commons-share" | "creative-commons-zero" | "critical-role" | "css3" | "css3-alt" | "cuttlefish" | "d-and-d" | "d-and-d-beyond" | "dashcube" | "delicious" | "deploydog" | "deskpro" | "dev" | "deviantart" | "dhl" | "diaspora" | "digg" | "digital-ocean" | "discord" | "discourse" | "dochub" | "docker" | "draft2digital" | "dribbble" | "dribbble-square" | "dropbox" | "drupal" | "dyalog" | "earlybirds" | "ebay" | "edge" | "elementor" | "ello" | "ember" | "empire" | "envira" | "erlang" | "ethereum" | "etsy" | "evernote" | "expeditedssl" | "facebook" | "facebook-f" | "facebook-messenger" | "facebook-square" | "fantasy-flight-games" | "fedex" | "fedora" | "figma" | "firefox" | "first-order" | "first-order-alt" | "firstdraft" | "flickr" | "flipboard" | "fly" | "font-awesome" | "font-awesome-alt" | "font-awesome-flag" | "fonticons" | "fonticons-fi" | "fort-awesome" | "fort-awesome-alt" | "forumbee" | "foursquare" | "free-code-camp" | "freebsd" | "fulcrum" | "galactic-republic" | "galactic-senate" | "get-pocket" | "gg" | "gg-circle" | "git" | "git-alt" | "git-square" | "github" | "github-alt" | "github-square" | "gitkraken" | "gitlab" | "gitter" | "glide" | "glide-g" | "gofore" | "goodreads" | "goodreads-g" | "google" | "google-drive" | "google-play" | "google-plus" | "google-plus-g" | "google-plus-square" | "google-wallet" | "gratipay" | "grav" | "gripfire" | "grunt" | "gulp" | "hacker-news" | "hacker-news-square" | "hackerrank" | "hips" | "hire-a-helper" | "hooli" | "hornbill" | "hotjar" | "houzz" | "html5" | "hubspot" | "imdb" | "instagram" | "intercom" | "internet-explorer" | "invision" | "ioxhost" | "itch-io" | "itunes" | "itunes-note" | "java" | "jedi-order" | "jenkins" | "jira" | "joget" | "joomla" | "js" | "js-square" | "jsfiddle" | "kaggle" | "keybase" | "keycdn" | "kickstarter" | "kickstarter-k" | "korvue" | "laravel" | "lastfm" | "lastfm-square" | "leanpub" | "less" | "line" | "linkedin" | "linkedin-in" | "linode" | "linux" | "lyft" | "magento" | "mailchimp" | "mandalorian" | "markdown" | "mastodon" | "maxcdn" | "mdb" | "medapps" | "medium" | "medium-m" | "medrt" | "meetup" | "megaport" | "mendeley" | "microsoft" | "mix" | "mixcloud" | "mizuni" | "modx" | "monero" | "napster" | "neos" | "nimblr" | "node" | "node-js" | "npm" | "ns8" | "nutritionix" | "odnoklassniki" | "odnoklassniki-square" | "old-republic" | "opencart" | "openid" | "opera" | "optin-monster" | "orcid" | "osi" | "page4" | "pagelines" | "palfed" | "patreon" | "paypal" | "penny-arcade" | "periscope" | "phabricator" | "phoenix-framework" | "phoenix-squadron" | "php" | "pied-piper" | "pied-piper-alt" | "pied-piper-hat" | "pied-piper-pp" | "pinterest" | "pinterest-p" | "pinterest-square" | "playstation" | "product-hunt" | "pushed" | "python" | "qq" | "quinscape" | "quora" | "r-project" | "raspberry-pi" | "ravelry" | "react" | "reacteurope" | "readme" | "rebel" | "red-river" | "reddit" | "reddit-alien" | "reddit-square" | "redhat" | "renren" | "replyd" | "researchgate" | "resolving" | "rev" | "rocketchat" | "rockrms" | "safari" | "salesforce" | "sass" | "schlix" | "scribd" | "searchengin" | "sellcast" | "sellsy" | "servicestack" | "shirtsinbulk" | "shopware" | "simplybuilt" | "sistrix" | "sith" | "sketch" | "skyatlas" | "skype" | "slack" | "slack-hash" | "slideshare" | "snapchat" | "snapchat-ghost" | "snapchat-square" | "soundcloud" | "sourcetree" | "speakap" | "speaker-deck" | "spotify" | "squarespace" | "stack-exchange" | "stack-overflow" | "stackpath" | "staylinked" | "steam" | "steam-square" | "steam-symbol" | "sticker-mule" | "strava" | "stripe" | "stripe-s" | "studiovinari" | "stumbleupon" | "stumbleupon-circle" | "superpowers" | "supple" | "suse" | "swift" | "symfony" | "teamspeak" | "telegram" | "telegram-plane" | "tencent-weibo" | "the-red-yeti" | "themeco" | "themeisle" | "think-peaks" | "trade-federation" | "trello" | "tripadvisor" | "tumblr" | "tumblr-square" | "twitch" | "twitter" | "twitter-square" | "typo3" | "uber" | "ubuntu" | "uikit" | "umbraco" | "uniregistry" | "untappd" | "ups" | "usb" | "usps" | "ussunnah" | "vaadin" | "viacoin" | "viadeo" | "viadeo-square" | "viber" | "vimeo" | "vimeo-square" | "vimeo-v" | "vine" | "vk" | "vnv" | "vuejs" | "waze" | "weebly" | "weibo" | "weixin" | "whatsapp" | "whatsapp-square" | "whmcs" | "wikipedia-w" | "windows" | "wix" | "wizards-of-the-coast" | "wolf-pack-battalion" | "wordpress" | "wordpress-simple" | "wpbeginner" | "wpexplorer" | "wpforms" | "wpressr" | "xbox" | "xing" | "xing-square" | "y-combinator" | "yahoo" | "yammer" | "yandex" | "yandex-international" | "yarn" | "yelp" | "yoast" | "youtube" | "youtube-square" | "zhihu";
/**
* Options for a message dialog button
*/
export interface DialogButton {
/** Button text */
text?: string;
/** Button hint */
hint?: string;
/** Button icon */
icon?: IconClassName;
/** Click handler */
click?: (e: MouseEvent) => void | false | Promise<void | false>;
/** CSS class for button */
cssClass?: string;
/** The code that is returned from message dialog function when this button is clicked.
* If this is set, and click event will not be defaultPrevented dialog will close.
*/
result?: string;
}
export type DialogProviderType = "bsmodal" | "uidialog" | "panel";
/**
* Options that apply to all dialog types
*/
export interface DialogOptions {
/** Auto dispose dialog on close, default is true */
autoDispose?: boolean;
/** True to auto open dialog */
autoOpen?: boolean;
/** Backdrop type, static to make it modal, e.g. can't be closed by clicking outside */
backdrop?: boolean | "static";
/** List of buttons to show on the dialog */
buttons?: DialogButton[];
/** Vertically center modal */
centered?: boolean;
/** Show close button, default is true */
closeButton?: boolean;
/** Close dialog on escape key. Default is true for message dialogs. */
closeOnEscape?: boolean;
/** CSS class to use for all dialog types. Is added to the top ui-dialog, panel or modal element */
dialogClass?: string;
/** Dialog content/body element, or callback that will populate the content element */
element?: HTMLElement | ArrayLike<HTMLElement> | ((element: HTMLElement) => void);
/** Enable / disable animation. Default is false for message dialogs, true for other dialogs */
fade?: boolean;
/** Sets one of modal-fullscreen{-...-down} classes. Only used for bootstrap modals */
fullScreen?: boolean | "sm-down" | "md-down" | "lg-down" | "xl-down" | "xxl-down";
/** Modal option for jQuery UI dialog compatibility only. Not to be confused with Bootstrap modal. */
modal?: boolean;
/** Event handler that is called when dialog is opened */
onOpen?: (e?: Event) => void;
/** Event handler that is called when dialog is closed */
onClose?: (result: string, e?: Event) => void;
/** Prefer Bootstrap modals to jQuery UI dialogs when both are available */
preferBSModal?: boolean;
/** Prefer Panel even when Modal / jQuery UI is available */
preferPanel?: boolean;
/** Callback to get options specific to the dialog provider type */
providerOptions?: (type: DialogProviderType, opt: DialogOptions) => any;
/** Scrollable, sets content of the modal to scrollable, only for Bootstrap */
scrollable?: boolean;
/** Size. Default is null for (500px) message dialogs, lg for normal dialogs */
size?: "sm" | "md" | "lg" | "xl";
/** Dialog title */
title?: string;
/** Only used for jQuery UI dialogs for backwards compatibility */
width?: number;
}
/**
* Wrapper for different types of dialogs, including jQuery UI, Bootstrap modals, and Panels.
*/
export declare class Dialog {
private el;
private dialogResult;
/**
* Creates a new dialog. The type of the dialog will be determined based on
* the availability of jQuery UI, Bootstrap, and the options provided.
* @param opt Optional configuration for the dialog
*/
constructor(opt?: DialogOptions);
/** Default set of dialog options */
static defaults: DialogOptions;
/** Default set of message dialog options */
static messageDefaults: MessageDialogOptions;
/**
* Gets the dialog instance for the specified element.
* @param el The dialog body element (.s-Panel, .ui-dialog-content, or .modal-body) or the root element (.modal, .ui-dialog, .s-Panel)
* @returns The dialog instance, or null if the element is not a dialog.
*/
static getInstance(el: HTMLElement | ArrayLike<HTMLElement>): Dialog;
/** The result code of the button that is clicked. Also attached to the dialog element as data-dialog-result */
get result(): string;
/** Closes dialog setting the result to null */
close(): this;
/** Closes dialog with the result set to value */
close(result: string): this;
/**
* Adds an event handler that is called when the dialog is closed. If the opt.before is true, the handler is called before the dialog is closed and
* the closing can be cancelled by calling preventDefault on the event object.
* @param handler The event handler function
* @param opt Options to determine whether the handler should be called before the dialog is closed, and whether the handler should be called only once.
* The default for oneOff is true unless opt.before is true.
* @returns The dialog instance
*/
onClose(handler: (result?: string, e?: Event) => void, opt?: {
before?: boolean;
oneOff?: boolean;
}): this;
/**
* Adds an event handler that is called when the dialog is closed. If the opt.before is true, the handler is called before the dialog is closed and
* the closing can be cancelled by calling preventDefault on the event object. Note that if the dialog is not yet initialized, the first argument must be
* the body element of the dialog.
* @param el The dialog body element (.s-Panel, .ui-dialog-content, or .modal-body)
* @param handler The event handler function
* @param opt Options to determine whether the handler should be called before the dialog is closed, and whether the handler should be called only once.
* The default for oneOff is true unless opt.before is true.
*/
static onClose(el: HTMLElement | ArrayLike<HTMLElement>, handler: (result?: string, e?: Event) => void, opt?: {
before?: boolean;
oneOff?: boolean;
}): void;
/**
* Adds an event handler that is called when the dialog is opened. If the second parameter is true, the handler is called before the dialog is opened and
* the opening can be cancelled by calling preventDefault on the event object.
* Note that if the dialog is not yet initialized, the first argument must be the body element of the dialog.
* @param handler The event handler function
* @param opt Options to determine whether the handler should be called before the dialog is opened, and whether the handler should be called only once.
* The default for oneOff is true unless opt.before is true.
* @returns The dialog instance
*/
onOpen(handler: (e?: Event) => void, opt?: {
before?: boolean;
oneOff?: boolean;
}): this;
/**
* Adds an event handler that is called when the dialog is opened. If the second parameter is true, the handler is called before the dialog is opened and
* the opening can be cancelled by calling preventDefault on the event object. Note that if the dialog is not yet initialized, the first argument must be
* the body element of the dialog.
* @param el The dialog body element (.s-Panel, .ui-dialog-content, or .modal-body)
* @param handler The event handler function
* @param opt Options to determine whether the handler should be called before the dialog is opened, and whether the handler should be called only once.
* The default for oneOff is true unless opt.before is true.
* @returns The dialog instance
*/
static onOpen(el: HTMLElement | ArrayLike<HTMLElement>, handler: (e?: Event) => void, opt?: {
before?: boolean;
oneOff?: boolean;
}): void;
/** Opens the dialog */
open(): this;
/** Gets the title text of the dialog */
title(): string;
/** Sets the title text of the dialog. */
title(value: string): this;
/** Returns the type of the dialog, or null if no dialog on the current element or if the element is null, e.g. dialog was disposed */
get type(): DialogProviderType;
/** Gets the body/content element of the dialog */
getContentNode(): HTMLElement;
/** Gets the dialog element of the dialog */
getDialogNode(): HTMLElement;
/** Gets the node that receives events for the dialog. It's .ui-dialog-content, .modal, or .panel-body */
getEventsNode(): HTMLElement;
/** Gets the footer element of the dialog */
getFooterNode(): HTMLElement;
/** Gets the header element of the dialog */
getHeaderNode(): HTMLElement;
private onButtonClick;
private createBSButtons;
private createBSModal;
private createPanel;
private createUIDialog;
/**
* Disposes the dialog, removing it from the DOM and unbinding all event handlers.
*/
dispose(): void;
}
/** Returns true if Bootstrap modal is available */
export declare function hasBSModal(): boolean;
/** Returns true if jQuery UI dialog is available */
export declare function hasUIDialog(): boolean;
/** Calls Bootstrap button.noConflict method if both jQuery UI and Bootstrap buttons are available in the page */
export declare function uiAndBSButtonNoConflict(): void;
/**
* Creates a dialog button which, by default, has "Yes" as caption (localized) and "ok" as the result.
* @param opt - Optional configuration for the dialog button.
* @returns The dialog button with the specified configuration.
*/
export declare function okDialogButton(opt?: DialogButton): DialogButton;
/**
* Creates a dialog button which, by default, has "Yes" as the caption (localized) and "yes" as the result.
* @param opt - Optional configuration for the dialog button.
* @returns The dialog button with the specified configuration.
*/
export declare function yesDialogButton(opt?: DialogButton): DialogButton;
/**
* Creates a dialog button which, by default, has "No" as the caption (localized) and "no" as the result.
* @param opt - Optional configuration for the dialog button.
* @returns The dialog button with the specified configuration.
*/
export declare function noDialogButton(opt?: DialogButton): DialogButton;
/**
* Creates a dialog button which, by default, has "Cancel" as the caption (localized) and "cancel" as the result.
* @param opt - Optional configuration for the dialog button.
* @returns The dialog button with the specified configuration.
*/
export declare function cancelDialogButton(opt?: DialogButton): DialogButton;
/**
* Namespace containing localizable text constants for dialogs.
*/
export declare namespace DialogTexts {
/**
* Title for alert dialogs.
*/
const AlertTitle: string;
/**
* Text for the cancel button in dialogs.
*/
const CancelButton: string;
/**
* Text for the close button in dialogs.
*/
const CloseButton: string;
/**
* Title for confirmation dialogs.
*/
const ConfirmationTitle: string;
/**
* Title for information dialogs.
*/
const InformationTitle: string;
/**
* Hint for maximizing dialogs.
*/
const MaximizeHint: string;
/**
* Text for the "No" button in dialogs.
*/
const NoButton: string;
/**
* Text for the "OK" button in dialogs.
*/
const OkButton: string;
/**
* Hint for restoring dialogs.
*/
const RestoreHint: string;
/**
* Title for success dialogs.
*/
const SuccessTitle: string;
/**
* Title for warning dialogs.
*/
const WarningTitle: string;
/**
* Text for the "Yes" button in dialogs.
*/
const YesButton: string;
}
/**
* Options that apply to all message dialog types
*/
export interface MessageDialogOptions extends DialogOptions {
/** HTML encode the message, default is true */
htmlEncode?: boolean;
/** Wrap the message in a `<pre>` element, so that line endings are preserved, default is true */
preWrap?: boolean;
}
/**
* Displays an alert dialog
* @param message The message to display
* @param options Additional options.
* @see AlertOptions
* @example
* alertDialog("An error occured!"); }
*/
export declare function alertDialog(message: string, options?: MessageDialogOptions): Partial<Dialog>;
/** Additional options for confirm dialog */
export interface ConfirmDialogOptions extends MessageDialogOptions {
/** True to also add a cancel button */
cancelButton?: boolean;
/** Event handler for cancel button click */
onCancel?: () => void;
/** Event handler for no button click */
onNo?: () => void;
}
/**
* Display a confirmation dialog
* @param message The message to display
* @param onYes Callback for Yes button click
* @param options Additional options.
* @see ConfirmOptions
* @example
* confirmDialog("Are you sure you want to delete?", () => {
* // do something when yes is clicked
* }
*/
export declare function confirmDialog(message: string, onYes: () => void, options?: ConfirmDialogOptions): Partial<Dialog>;
/**
* Display an information dialog
* @param message The message to display
* @param onOk Callback for OK button click
* @param options Additional options.
* @see ConfirmOptions
* @example
* informationDialog("Operation complete", () => {
* // do something when OK is clicked
* }
*/
export declare function informationDialog(message: string, onOk?: () => void, options?: MessageDialogOptions): Partial<Dialog>;
/**
* Display a success dialog
* @param message The message to display
* @param onOk Callback for OK button click
* @param options Additional options.
* @see MessageDialogOptions
* @example
* successDialog("Operation complete", () => {
* // do something when OK is clicked
* }
*/
export declare function successDialog(message: string, onOk?: () => void, options?: MessageDialogOptions): Partial<Dialog>;
/**
* Display a warning dialog
* @param message The message to display
* @param options Additional options.
* @see MessageDialogOptions
* @example
* warningDialog("Something is odd!");
*/
export declare function warningDialog(message: string, options?: MessageDialogOptions): Partial<Dialog>;
/** Options for `iframeDialog` **/
export interface IFrameDialogOptions {
html?: string;
}
/**
* Display a dialog that shows an HTML block in an IFRAME, which is usually returned from server callbacks
* @param options The options
*/
export declare function iframeDialog(options: IFrameDialogOptions): Partial<Dialog>;
export declare function getjQuery(): any;
/** Returns true if Bootstrap 3 is loaded */
export declare function isBS3(): boolean;
/** Returns true if Bootstrap 5+ is loaded */
export declare function isBS5Plus(): boolean;
export interface ServiceError {
Code?: string;
Arguments?: string;
Message?: str