diff --git a/types/chartist/chartist-tests.ts b/types/chartist/chartist-tests.ts index 53ba63497c..270e6e0970 100644 --- a/types/chartist/chartist-tests.ts +++ b/types/chartist/chartist-tests.ts @@ -247,7 +247,7 @@ new Chartist.Pie('.ct-chart', { value: 70, name: 'Series 3', className: 'my-custom-class-three', - meta: 'Meta Three' + meta: { description: 'Meta Three' } }] }); diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts index a4fb2c832d..80cc589ee2 100644 --- a/types/chartist/index.d.ts +++ b/types/chartist/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Chartist v0.9.81 // Project: https://github.com/gionkunz/chartist-js -// Definitions by: Matt Gibbs , Simon Pfeifer , Cassey Lottman , Anastasiia Antonova +// Definitions by: Matt Gibbs , Simon Pfeifer , Cassey Lottman , Anastasiia Antonova , Sunny Juneja // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Chartist { @@ -101,7 +101,7 @@ declare namespace Chartist { value?: number; data?: Array; className?: string; - meta?: string; // I assume this could probably be a number as well? + meta?: any; } interface IChartistBase { diff --git a/types/chromecast-caf-receiver/cast.framework.breaks.d.ts b/types/chromecast-caf-receiver/cast.framework.breaks.d.ts new file mode 100644 index 0000000000..21adf13fb0 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.breaks.d.ts @@ -0,0 +1,92 @@ +import { Break, BreakClip } from "./cast.framework.messages"; + +export = cast.framework.breaks; + +declare namespace cast.framework.breaks { + class BreakSeekData { + constructor(seekFrom: number, seekTo: number, breaks: Break[]); + + /** + * List of breaks + */ + breaks: Break[]; + + /** + * Current playback time + */ + seekFrom: number; + + /** + * The time to seek to + */ + seekTo: number; + } + + /** Provide context information for break clip load interceptor. */ + class BreakClipLoadInterceptorContext { + constructor(brk: Break); + + /** + * The container break for the break clip + */ + break: Break; + } + + /** Interface to manage breaks */ + interface BreakManager { + /** + * Get current media break by id. + */ + getBreakById(id: string): Break; + + /** + * Get current media break clip by id + */ + getBreakClipById(id: string): BreakClip; + + /** Get current media break clips. */ + getBreakClips(): BreakClip[]; + + /** Get current media breaks. */ + getBreaks(): Break[]; + + /** Returns true if watched breaks should be played. */ + getPlayWatchedBreak(): boolean; + + /** + * Provide an interceptor to allow developer to insert more break clips or modify current break clip before a break is started. + * If interceptor is null it will reset the interceptor to default one. + * By default VAST fetching and parsing logic in default interceptor. + * So if customized interceptor is set by developer; + * the VAST logic will be overridden and developers should implement their own VAST fetching and parsing logic in the provided interceptor. + */ + setBreakClipLoadInterceptor( + interceptor: ( + breakClip: BreakClip, + breakClipLoaderContext?: BreakClipLoadInterceptorContext + ) => void + ): void; + + /** + * Provide an interceptor for developer to specify what breaks they want to play after seek. + */ + setBreakSeekInterceptor( + seekInterceptor: (breakSeekData: BreakSeekData) => void + ): void; + + /** + * Set a flag to control if the watched client stitching break should be played. + */ + setPlayWatchedBreak(playWatchedBreak: boolean): void; + + /** + * Provide an interceptor to modify VAST tracking URL before it is being sent to server. + * The input of the interceptor is a string of the tracking URL. + * The interceptor can either return a modified string of URL or a Promise of modified string of URL. + * The interceptor can also return null if you want to send the tracking URL by your own code instead of by CAF. + */ + setVastTrackingInterceptor( + interceptor?: (trackingUrl: string) => void + ): void; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.d.ts b/types/chromecast-caf-receiver/cast.framework.d.ts new file mode 100644 index 0000000000..28b0c69e2d --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.d.ts @@ -0,0 +1,783 @@ +import { EventType } from "./cast.framework.events"; +import { + PlayerState, + PlayStringId, + ErrorType, + ErrorReason, + IdleReason, + MessageType, + Track, + TextTrackStyle, + QueueItem, + LoadRequestData, + QueueData, + Break, + LiveSeekableRange, + MediaInformation, + ErrorData, + RequestData +} from "./cast.framework.messages"; +import { BreakManager } from "./cast.framework.breaks"; +import { EventHandler, RequestHandler, BinaryHandler } from "./index"; +import { + EventType as SystemEventType, + ApplicationData, + Sender, + StandbyState, + SystemState +} from "./cast.framework.system"; + +export = cast.framework; +type HTMLMediaElement = any; +declare namespace cast.framework { + type LoggerLevel = + | "DEBUG" + | "VERBOSE" + | "INFO" + | "WARNING" + | "ERROR" + | "NONE"; + + type ContentProtection = "NONE" | "CLEARKEY" | "PLAYREADY" | "WIDEVINE"; + + /** + * Manages text tracks. + */ + class TextTracksManager { + constructor(params?: any); + + /** + * Adds text tracks to the list. + */ + addTracks(tracks: Track[]): void; + + /** + * Creates a text track. + */ + createTrack(): Track; + + /** + * Gets all active text ids. + */ + getActiveIds(): number[]; + + /** + * Gets all active text tracks. + */ + getActiveTracks(): Track[]; + + /** + * Returns the current text track style. + */ + getTextTracksStyle(): TextTrackStyle; + + /** + * Gets text track by id. + */ + getTrackById(id: number): Track; + + /** + * Returns all text tracks. + */ + getTracks(): Track[]; + + /** + * Gets text tracks by language. + */ + getTracksByLanguage(language: string): Track[]; + + /** + * Sets text tracks to be active by id. + */ + setActiveByIds(newIds: number[]): void; + + /** + * Sets text tracks to be active by language. + */ + setActiveByLanguage(language: string): void; + + /** + * Sets text track style. + */ + setTextTrackStyle(style: TextTrackStyle): void; + } + + /** + * QueueManager exposes several queue manipulation APIs to developers. + */ + class QueueManager { + constructor(params?: any); + + /** + * Returns the current queue item. + */ + getCurrentItem(): QueueItem; + + /** + * Returns the index of the current queue item. + */ + getCurrentItemIndex(): number; + + /** + * Returns the queue items. + */ + getItems(): QueueItem[]; + + /** + * Inserts items into the queue. + */ + insertItems(items: QueueItem[], insertBefore?: number): void; + + /** + * Removes items from the queue. + */ + removeItems(itemIds: number[]): void; + + /** + * Sets whether to limit the number of queue items to be reported in Media Status (default is true). + */ + setQueueStatusLimit(limitQueueItemsInStatus: boolean): void; + + /** + * Updates existing queue items by matching itemId. + */ + updateItems(items: QueueItem[]): void; + } + + /** + * Base implementation of a queue. + */ + class QueueBase { + /** + * Fetches a window of items using the specified item id as reference; called by the receiver MediaManager when it needs more queue items; + * often as a request from senders. If only one of nextCount and prevCount is non-zero; fetchItems should only return items after or before + * the reference item; if both nextCount and prevCount are non-zero; a window of items including the reference item should be returned. + */ + fetchItems( + itemId: number, + nextCount: number, + prevCount: number + ): QueueItem[] | Promise; + + /** + * Initializes the queue with the requestData. This is called when a new LOAD request comes in to the receiver. + * If this returns or resolves to null; our default queueing implementation will create a queue based on queueData.items or the single media + * in the load request data. + */ + initialize( + requestData: LoadRequestData + ): QueueData | Promise; + + /** + * Returns next items after the reference item; often the end of the current queue; called by the receiver MediaManager. + */ + nextItems(itemId?: number): QueueItem[] | Promise; + + /** + * Sets the current item with the itemId; called by the receiver MediaManager when it changes the current playing item. + */ + onCurrentItemIdChanged(itemId: number): void; + + /** + * A callback for informing the following items have been inserted into the receiver queue in this session. + * A cloud based implementation can optionally choose to update its queue based on the new information. + */ + onItemsInserted(items: QueueItem[], insertBefore?: number): void; + + /** + * A callback for informing the following items have been removed from the receiver queue in this session. + * A cloud based implementation can optionally choose to update its queue based on the new information. + */ + onItemsRemoved(itemIds: number[]): void; + + /** + * Returns previous items before the reference item; often at the beginning of the queue; called by the receiver MediaManager. + */ + prevItems(itemId?: number): QueueItem[] | Promise; + + /** + * Shuffles the queue and returns new queue items. Returns null if the operation is not supported. + */ + shuffle(): QueueItem[] | Promise; + } + + /** + * Controls and monitors media playback. + */ + class PlayerManager { + constructor(params?: any); + + /** + * Adds an event listener for player event. + */ + addEventListener: ( + eventType: EventType | EventType[], + eventListener: EventHandler + ) => void; + + /** + * Sends a media status message to all senders (broadcast). Applications use this to send a custom state change. + */ + broadcastStatus( + includeMedia?: boolean, + requestId?: number, + customData?: any, + includeQueueItems?: boolean + ): void; + + getAudioTracksManager(): AudioTracksManager; + + /** + * Returns current time in sec in currently-playing break clip. + */ + getBreakClipCurrentTimeSec(): number; + + /** + * Returns duration in sec of currently-playing break clip. + */ + getBreakClipDurationSec(): number; + + /** + * Obtain the breaks (Ads) manager. + */ + getBreakManager(): BreakManager; + + /** + * Returns list of breaks. + */ + getBreaks(): Break[]; + + /** + * Gets current time in sec of current media. + */ + getCurrentTimeSec(): number; + + /** + * Gets duration in sec of currently playing media. + */ + getDurationSec(): number; + + /** + * Returns live seekable range with start and end time in seconds. The values are media time based. + */ + getLiveSeekableRange(): LiveSeekableRange; + + /** + * Gets media information of current media. + */ + getMediaInformation(): MediaInformation; + + /** + * Returns playback configuration. + */ + getPlaybackConfig(): PlaybackConfig; + + /** + * Returns current playback rate. + */ + getPlaybackRate(): number; + + /** + * Gets player state. + */ + getPlayerState(): PlayerState; + + /** + * Get the preferred playback rate. (Can be used on shutdown event to save latest preferred playback rate to a persistent storage; + * so it can be used in next session in the cast options). + */ + getPreferredPlaybackRate(): number; + + /** + * Get the preferred text track language. + */ + getPreferredTextLanguage(): string; + + /** + * Obtain QueueManager API. + */ + getQueueManager(): QueueManager; + + getTextTracksManager(): TextTracksManager; + + /** + * Loads media. + */ + load(loadRequest: LoadRequestData): Promise; + + /** + * Pauses currently playing media. + */ + pause(): void; + + /** + * Plays currently paused media. + */ + play(): void; + + /** + * Requests a text string to be played back locally on the receiver device. + */ + playString(stringId: PlayStringId, args?: string[]): Promise; + + /** + * Request Google Assistant to refresh the credentials. Only works if the original credentials came from the assistant. + */ + refreshCredentials(): Promise; + + /** + * Removes the event listener added for given player event. If event listener is not added; it will be ignored. + */ + removeEventListener( + eventType: EventType | EventType[], + eventListener: EventHandler + ): void; + + /** + * Seeks in current media. + */ + seek(seekTime: number): void; + + /** + * Sends an error to a specific sender + */ + sendError( + senderId: string, + requestId: number, + type: ErrorType, + reason?: ErrorReason, + customData?: any + ): void; + + /** + * Send local media request. + */ + sendLocalMediaRequest(request: RequestData): void; + + /** + * Sends a media status message to a specific sender. + */ + sendStatus( + senderId: string, + requestId: number, + includeMedia?: boolean, + customData?: any, + includeQueueItems?: boolean + ): void; + + /** + * Sets the IDLE reason. This allows applications that want to force the IDLE state to indicate the reason that made the player going to IDLE state + * (a custom error; for example). The idle reason will be sent in the next status message. NOTE: Most applications do not need to set this value; + * it is only needed if they want to make the player go to IDLE in special circumstances and the default idleReason does not reflect their intended + * behavior. + */ + setIdleReason(idleReason: IdleReason): void; + + /** + * Sets MediaElement to use. If Promise of MediaElement is set; media begins playback after Promise is resolved. + */ + setMediaElement(mediaElement: HTMLMediaElement): void; + + /** + * Sets media information. + */ + setMediaInformation( + mediaInformation: MediaInformation, + opt_broadcast?: boolean + ): void; + + /** + * Sets a handler to return or modify PlaybackConfig; for a specific load request. The handler paramaters are the load request data + * and default playback config for the receiver (provided in the context options). The handler should returns a modified playback config; + * or null to prevent the media from playing. The return value can be a promise to allow waiting for data from the server. + */ + setMediaPlaybackInfoHandler( + handler: ( + loadRequestData: LoadRequestData, + playbackConfig: PlaybackConfig + ) => void + ): void; + + /** + * Sets a handler to return the media url for a load request. This handler can be used to avoid having the media content url published as part + * of the media status. By default the media contentId is used as the content url. + */ + setMediaUrlResolver( + resolver: (loadRequestData: LoadRequestData) => void + ): void; + + /** + * Provide an interceptor of incoming and outgoing messages. + * The interceptor can update the request data; and return updated data; a promise of + * updated data if need to get more data from the server; or null if the request should not be handled. + * Note that if load message interceptor is provided; and no interceptor is provided for preload - + * the load interceptor will be called for preload messages. + */ + setMessageInterceptor( + type: MessageType, + interceptor: (requestData: RequestData) => Promise + ): void; + + /** + * Sets playback configuration on the PlayerManager. + */ + setPlaybackConfig(playbackConfig: PlaybackConfig): void; + + /** + * Set the preferred playback rate for follow up load or media items. The preferred playback rate will be updated automatically to the latest + * playback rate that was provided by a load request or explicit set of playback rate. + */ + setPreferredPlaybackRate(preferredPlaybackRate: number): void; + + /** + * Set the preferred text track language. The preferred text track language will be updated automatically to the latest enabled language + * by a load request or explicit change to text tracks. (Should be called only in idle state; and Will only apply to next loaded media). + */ + setPreferredTextLanguage(preferredTextLanguage: string): void; + + /** + * Stops currently playing media. + */ + stop(): void; + } + + /** + * Configuration to customize playback behavior. + */ + class PlaybackConfig { + /** + * Duration of buffered media in seconds to start buffering. + */ + autoPauseDuration?: number; + + /** + * Duration of buffered media in seconds to start/resume playback after auto-paused due to buffering. + */ + autoResumeDuration?: number; + + /** + * Minimum number of buffered segments to start/resume playback. + */ + autoResumeNumberOfSegments?: number; + + /** + * A function to customize request to get a caption segment. + */ + captionsRequestHandler?: RequestHandler; + + /** + * Initial bandwidth in bits in per second. + */ + initialBandwidth?: number; + + /** + * Custom license data. + */ + licenseCustomData?: string; + + /** + * Handler to process license data. The handler is passed the license data; and returns the modified license data. + */ + licenseHandler?: BinaryHandler; + + /** + * A function to customize request to get a license. + */ + licenseRequestHandler?: RequestHandler; + + /** + * Url for acquiring the license. + */ + licenseUrl?: string; + + /** + * Handler to process manifest data. The handler is passed the manifest; and returns the modified manifest. + */ + manifestHandler?: (manifest: string) => string; + + /** + * A function to customize request to get a manifest. + */ + manifestRequestHandler?: RequestHandler; + + /** + * Preferred protection system to use for decrypting content. + */ + protectionSystem: ContentProtection; + + /** + * Handler to process segment data. The handler is passed the segment data; and returns the modified segment data. + */ + segmentHandler?: BinaryHandler; + + /** + * A function to customize request information to get a media segment. + */ + segmentRequestHandler?: RequestHandler; + + /** + * Maximum number of times to retry a network request for a segment. + */ + segmentRequestRetryLimit?: number; + } + /** + * HTTP(s) Request/Response information. + */ + class NetworkRequestInfo { + /** + * The content of the request. Can be used to modify license request body. + */ + content: Uint8Array; + + /** + * An object containing properties that you would like to send in the header. + */ + headers: any; + + /** + * The URL requested. + */ + url: string; + + /** + * Indicates whether CORS Access-Control requests should be made using credentials such as cookies or authorization headers. + */ + withCredentials: boolean; + } + /** Cast receiver context options. All options are optionals. */ + class CastReceiverOptions { + /** + * Optional map of custom messages namespaces to initialize and their types. + * Custom messages namespaces need to be initiated before the application started; + * so it is best to provide the namespaces in the receiver options. + * (The default type of a message bus is JSON; if not provided here). + */ + customNamespaces?: any; + + /** + * Sender id used for local requests. Default value is 'local'. + */ + localSenderId?: string; + + /** + * Maximum time in seconds before closing an idle sender connection. + * Setting this value enables a heartbeat message to keep the connection alive. + * Used to detect unresponsive senders faster than typical TCP timeouts. + * The minimum value is 5 seconds; there is no upper bound enforced but practically it's minutes before platform TCP timeouts come into play. + * Default value is 10 seconds. + */ + maxInactivity?: number; + + /** + * Optional media element to play content with. Default behavior is to use the first found media element in the page. + */ + mediaElement?: HTMLMediaElement; + + /** + * Optional playback configuration. + */ + playbackConfig?: PlaybackConfig; + + /** + * If this is true; the watched client stitching break will also be played. + */ + playWatchedBreak?: boolean; + + /** + * Preferred value for player playback rate. It is used if playback rate value is not provided in the load request. + */ + preferredPlaybackRate?: number; + + /** + * Preferred text track language. It is used if no active track is provided in the load request. + */ + preferredTextLanguage?: string; + + /** + * Optional queue implementation. + */ + queue?: QueueBase; + + /** + * Text that represents the application status. + * It should meet internationalization rules as may be displayed by the sender application. + */ + statusText?: string; + + /** + * A bitmask of media commands supported by the application. + * LOAD; PLAY; STOP; GET_STATUS must always be supported. + * If this value is not provided; then PAUSE; SEEK; STREAM_VOLUME; STREAM_MUTE are assumed to be supported too. + */ + supportedCommands?: number; + + /** + * Indicate that MPL should be used for DASH content. + */ + useLegacyDashSupport?: boolean; + + /** + * An integer used as an internal version number. + * This number is used only to distinguish between receiver releases and higher numbers do not necessarily have to represent newer releases. + */ + versionCode?: number; + } + + /** Manages loading of underlying libraries and initializes underlying cast receiver SDK. */ + class CastReceiverContext { + /** Returns the CastReceiverContext singleton instance. */ + static getInstance(): CastReceiverContext; + + constructor(params: any); + + /** + * Sets message listener on custom message channel. + */ + addCustomMessageListener( + namespace: string, + listener: EventHandler + ): void; + + /** + * Add listener to cast system events. + */ + addEventListener( + type: SystemEventType | SystemEventType[], + handler: EventHandler + ): void; + + /** + * Checks if the given media params of video or audio streams are supported by the platform. + */ + canDisplayType( + mimeType: string, + codecs?: string, + width?: number, + height?: number, + framerate?: number + ): boolean; + + /** + * Provides application information once the system is ready; otherwise it will be null. + */ + getApplicationData(): ApplicationData; + + /** + * Provides device capabilities information once the system is ready; otherwise it will be null. + * If an empty object is returned; the device does not expose any capabilities information. + */ + getDeviceCapabilities(): any; + + /** + * Get Player instance that can control and monitor media playback. + */ + getPlayerManager(): PlayerManager; + + /** + * Get a sender by sender id + */ + getSender(senderId: string): Sender; + + /** + * Gets a list of currently-connected senders. + */ + getSenders(): Sender[]; + + /** + * Reports if the cast application's HDMI input is in standby. + */ + getStandbyState(): StandbyState; + + /** + * Provides application information about the system state. + */ + getSystemState(): SystemState; + + /** + * Reports if the cast application is the HDMI active input. + */ + getVisibilityState(): any; + + /** + * When the application calls start; the system will send the ready event to indicate + * that the application information is ready and the application can send messages as soon as there is one sender connected. + */ + isSystemReady(): boolean; + + /** + * Start loading player js. This can be used to start loading the players js code in early stage of starting the receiver before calling start. + * This function is a no-op if players were already loaded (start was called). + */ + loadPlayerLibraries(useLegacyDashSupport?: boolean): void; + + /** + * Remove a message listener on custom message channel. + */ + removeCustomMessageListener( + namespace: string, + listener: EventHandler + ): void; + + /** + * Remove listener to cast system events. + */ + removeEventListener(type: EventType, handler: EventHandler): void; + + /** + * Sends a message to a specific sender. + */ + sendCustomMessage( + namespace: string, + senderId: string, + message: any + ): void; + + /** + * This function should be called in response to the feedbackstarted event if the application + * add debug state information to log in the feedback report. + * It takes in a parameter ‘message’ that is a string that represents the debug information that the application wants to log. + */ + sendFeedbackMessage(feedbackMessage: string): void; + + /** + * Sets the application state. The application should call this when its state changes. + * If undefined or set to an empty string; the value of the Application Name established during application + * registration is used for the application state by default. + */ + setApplicationState(statusText: string): void; + + /** + * Sets the receiver inactivity timeout. + * It is recommended to set the maximum inactivity value when calling Start and not changing it. + * This API is just provided for development/debugging purposes. + */ + setInactivityTimeout(maxInactivity: number): void; + + /** + * Sets the log verbosity level. + */ + setLoggerLevel(level: LoggerLevel): void; + + /** + * Initializes system manager and media manager; so that receiver app can receive requests from senders. + */ + start(options?: CastReceiverOptions): CastReceiverContext; + + /** + * Shutdown receiver application. + */ + stop(): void; + } + + /** Manages audio tracks. */ + class AudioTracksManager { + constructor(params: any); + getActiveId(): number; + getActiveTrack(): Track; + getTrackById(id: number): Track; + getTracks(): Track[]; + getTracksByLanguage(language: string): Track[]; + setActiveById(id: number): void; + setActiveByLanguage(language: string): void; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.events.d.ts b/types/chromecast-caf-receiver/cast.framework.events.d.ts new file mode 100644 index 0000000000..0c69727a05 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.events.d.ts @@ -0,0 +1,420 @@ +import { + RequestData, + MediaInformation, + Track, + MediaStatus +} from "./cast.framework.messages"; +export = cast.framework.events; + +declare namespace cast.framework.events { + type EventType = + | "ALL" + | "ABORT" + | "CAN_PLAY" + | "CAN_PLAY_THROUGH" + | "DURATION_CHANGE" + | "EMPTIED" + | "ENDED" + | "LOADED_DATA" + | "LOADED_METADATA" + | "LOAD_START" + | "PAUSE" + | "PLAY" + | "PLAYING" + | "PROGRESS" + | "RATE_CHANGE" + | "SEEKED" + | "SEEKING" + | "STALLED" + | "TIME_UPDATE" + | "SUSPEND" + | "WAITING" + | "BITRATE_CHANGED" + | "BREAK_STARTED" + | "BREAK_ENDED" + | "BREAK_CLIP_LOADING" + | "BREAK_CLIP_STARTED" + | "BREAK_CLIP_ENDED" + | "BUFFERING" + | "CACHE_LOADED" + | "CACHE_HIT" + | "CACHE_INSERTED" + | "CLIP_STARTED" + | "CLIP_ENDED" + | "EMSG" + | "ERROR" + | "ID3" + | "MEDIA_STATUS" + | "MEDIA_FINISHED" + | "PLAYER_PRELOADING" + | "PLAYER_PRELOADING_CANCELLED" + | "PLAYER_LOAD_COMPLETE" + | "PLAYER_LOADING" + | "SEGMENT_DOWNLOADED" + | "REQUEST_SEEK" + | "REQUEST_LOAD" + | "REQUEST_STOP" + | "REQUEST_PAUSE" + | "REQUEST_PLAY" + | "REQUEST_PLAY_AGAIN" + | "REQUEST_PLAYBACK_RATE_CHANGE" + | "REQUEST_SKIP_AD" + | "REQUEST_VOLUME_CHANGE" + | "REQUEST_EDIT_TRACKS_INFO" + | "REQUEST_EDIT_AUDIO_TRACKS" + | "REQUEST_SET_CREDENTIALS" + | "REQUEST_LOAD_BY_ENTITY" + | "REQUEST_USER_ACTION" + | "REQUEST_DISPLAY_STATUS" + | "REQUEST_CUSTOM_COMMAND" + | "REQUEST_FOCUS_STATE" + | "REQUEST_QUEUE_LOAD" + | "REQUEST_QUEUE_INSERT" + | "REQUEST_QUEUE_UPDATE" + | "REQUEST_QUEUE_REMOVE" + | "REQUEST_QUEUE_REORDER" + | "REQUEST_QUEUE_GET_ITEM_RANGE" + | "REQUEST_QUEUE_GET_ITEMS" + | "REQUEST_QUEUE_GET_ITEM_IDS" + | "REQUEST_PRECACHE"; + + type DetailedErrorCode = + | "MEDIA_UNKNOWN" + | "MEDIA_ABORTED" + | "MEDIA_DECODE" + | "MEDIA_NETWORK" + | "MEDIA_SRC_NOT_SUPPORTED" + | "SOURCE_BUFFER_FAILURE" + | "MEDIAKEYS_UNKNOWN" + | "MEDIAKEYS_NETWORK" + | "MEDIAKEYS_UNSUPPORTED" + | "MEDIAKEYS_WEBCRYPTO" + | "NETWORK_UNKNOWN" + | "SEGMENT_NETWORK" + | "HLS_NETWORK_MASTER_PLAYLIST" + | "HLS_NETWORK_PLAYLIST" + | "HLS_NETWORK_NO_KEY_RESPONSE" + | "HLS_NETWORK_KEY_LOAD" + | "HLS_NETWORK_INVALID_SEGMENT" + | "HLS_SEGMENT_PARSING" + | "DASH_NETWORK" + | "DASH_NO_INIT" + | "SMOOTH_NETWORK" + | "SMOOTH_NO_MEDIA_DATA" + | "MANIFEST_UNKNOWN" + | "HLS_MANIFEST_MASTER" + | "HLS_MANIFEST_PLAYLIST" + | "DASH_MANIFEST_UNKNOWN" + | "DASH_MANIFEST_NO_PERIODS" + | "DASH_MANIFEST_NO_MIMETYPE" + | "DASH_INVALID_SEGMENT_INFO" + | "SMOOTH_MANIFEST" + | "SEGMENT_UNKNOWN" + | "TEXT_UNKNOWN" + | "APP" + | "BREAK_CLIP_LOADING_ERROR" + | "BREAK_SEEK_INTERCEPTOR_ERROR" + | "IMAGE_ERROR" + | "LOAD_INTERRUPTED" + | "GENERIC"; + + type EndedReason = + | "END_OF_STREAM" + | "ERROR" + | "STOPPED" + | "INTERRUPTED" + | "SKIPPED" + | "BREAK_SWITCH"; + + /** + * Event data for @see{@link EventType.SEGMENT_DOWNLOADED} event. + */ + class SegmentDownloadedEvent extends Event { + constructor(downloadTime?: number, size?: number); + + /** + * The time it took to download the segment; in milliseconds. + */ + downloadTime?: number; + + /** + * The number of bytes in the segment. + */ + size?: number; + } + + /** + * Event data for all events that represent requests made to the receiver. + */ + class RequestEvent extends Event { + constructor( + type: EventType, + requestData?: RequestData, + senderId?: string + ); + + /** + * The data that was sent with the request. + */ + requestData?: RequestData; + + /** + * The sender id the request came from. + */ + senderId?: string; + } + + /** + * Event data superclass for all events dispatched by @see{@link PlayerManager} + */ + class Event { + constructor(type: EventType); + + /** + * Type of the event. + */ + type: EventType; + } + /** + * Event data for @see{@link EventType.MEDIA_STATUS} event. + */ + class MediaStatusEvent extends Event { + constructor(type: EventType, mediaStatus?: MediaStatus); + + /** + * The media status that was sent. + */ + mediaStatus?: MediaStatus; + } + /** + * Event data for pause events forwarded from the MediaElement. + */ + class MediaPauseEvent extends Event { + constructor(currentMediaTime?: number, ended?: boolean); + + /** + * Indicate if the media ended (indicates the pause was fired due to stream reached the end). + */ + ended?: boolean; + } + /** + * Event data for @see{@link EventType.MEDIA_FINISHED} event. + */ + class MediaFinishedEvent extends Event { + constructor(currentMediaTime?: number, endedReason?: EndedReason); + + /** + * The time when the media finished (in seconds). For an item in a queue; this value represents the time in the currently playing queue item ( where 0 means the queue item has just started). + */ + currentTime?: number; + + /** + * The reason the media finished. + */ + endedReason?: EndedReason; + } + /** + * Event data for all events forwarded from the MediaElement. + */ + class MediaElementEvent extends Event { + constructor(type: EventType, currentMediaTime?: number); + + /** + * The time in the currently playing clip when the event was fired (in seconds). Undefined if playback has not started yet. + */ + currentMediaTime?: number; + } + /** + * Event data for all events pertaining to processing a load / preload request. made to the player. + */ + class LoadEvent extends Event { + constructor(type: EventType, media?: MediaInformation); + + /** + * Information about the media being loaded. + */ + media: MediaInformation; + } + /** + * Event data for @see{@link EventType.INBAND_TRACK_ADDED} event. + */ + class InbandTrackAddedEvent { + constructor(track: Track); + + /** + * Added track. + */ + track: Track; + } + + /** Event data for @see{@link EventType.ID3} event. */ + class Id3Event extends Event { + constructor(segmentData: Uint8Array); + + /** + * The segment data. + */ + segmentData: Uint8Array; + } + /** + * Event data for @see{@link EventType.EMSG} event. + */ + class EmsgEvent extends Event { + constructor(emsgData: any); + + /** + * The time that the event ends (in presentation time). Undefined if using legacy Dash support. + */ + endTime: any; + + /** + * The duration of the event (in units of timescale). Undefined if using legacy Dash support. + */ + eventDuration: any; + + /** + * A field identifying this instance of the message. Undefined if using legacy Dash support. + */ + id: any; + + /** + * Body of the message. Undefined if using legacy Dash support. + */ + messageData: any; + + /** + * The offset that the event starts; relative to the start of the segment this is contained in (in units of timescale). Undefined if using legacy Dash support. + */ + presentationTimeDelta: any; + + /** + * Identifies the message scheme. Undefined if using legacy Dash support. + */ + schemeIdUri: any; + + /** + * The segment data. This is only defined if using legacy Dash support. + */ + segmentData: any; + + /** + * The time that the event starts (in presentation time). Undefined if using legacy Dash support. + */ + startTime: any; + + /** + * Provides the timescale; in ticks per second. Undefined if using legacy Dash support. + */ + timescale: any; + + /** + * Specifies the value for the event. Undefined if using legacy Dash support. + */ + value: any; + } + /** + * Event data for @see{@link EventType.CLIP_ENDED} event. + */ + class ClipEndedEvent extends Event { + constructor(currentMediaTime: number, endedReason?: EndedReason); + + /** + * The time in media (in seconds) when clip ended. + */ + currentMediaTime: number; + + /** + * The reason the clip ended. + */ + endedReason?: EndedReason; + } + + /** + * Event data for @see{@link EventType.CACHE_LOADED} event. + */ + class CacheLoadedEvent extends Event { + constructor(media?: MediaInformation); + + /** + * Information about the media being cached. + */ + media: MediaInformation; + } + + class CacheItemEvent extends Event { + constructor(type: EventType, url: string); + + /** + * The URL of data fetched from cache + */ + url: string; + } + + class BufferingEvent extends Event { + constructor(isBuffering: boolean); + + /** + * True if the player is entering a buffering state. + */ + isBuffering: boolean; + } + + class BreaksEvent extends Event { + constructor( + type: EventType, + currentMediaTime?: number, + index?: number, + total?: number, + whenSkippable?: number, + endedReason?: EndedReason, + breakClipId?: string + ); + + /** + * The break clip's id. Refer to BreakClip.id + */ + breakClipId?: string; + + /** + * The time in the currently playing media when the break event occurred. + */ + currentMediaTime?: number; + + /** + * The reason the break clip ended. + */ + endedReason?: EndedReason; + + /** + * Index of break clip; which starts from 1. + */ + index: number; + + /** + * Total number of break clips. + */ + total: number; + + /** + * When to skip current break clip in sec; after break clip begins to play. + */ + whenSkippable?: number; + } + + /** + * Event data for @see {@link EventType.BITRATE_CHANGED} event. + */ + class BitrateChangedEvent { + constructor(totalBitrate?: number); + + /** The bitrate of the media (audio and video) in bits per second. */ + totalBitrate: number; + } + + class ErrorEvent extends Event { + constructor(detailedErrorCode: DetailedErrorCode, error?: any); + + detailedErrorCode: DetailedErrorCode; + error?: any; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts new file mode 100644 index 0000000000..d6dda6d145 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -0,0 +1,1900 @@ +import { Event, DetailedErrorCode } from "./cast.framework.events"; +export = cast.framework.messages; + +declare namespace cast.framework.messages { + type UserAction = + | "LIKE" + | "DISLIKE" + | "FOLLOW" + | "UNFOLLOW" + | "FLAG" + | "SKIP_AD"; + + type UserActionContext = + | "UNKNOWN_CONTEXT" + | "ALBUM" + | "ARTIST" + | "PLAYLIST" + | "EPISODE" + | "SERIES" + | "MOVIE" + | "CHANNEL" + | "TEAM" + | "PLAYER" + | "COACH"; + + type TextTrackType = + | "SUBTITLES" + | "CAPTIONS" + | "DESCRIPTIONS" + | "CHAPTERS" + | "METADATA"; + + type TextTrackWindowType = "NONE" | "NORMAL" | "ROUNDED_CORNERS"; + + type TrackType = "TEXT" | "AUDIO" | "VIDEO"; + + type TextTrackFontGenericFamily = + | "SANS_SERIF" + | "MONOSPACED_SANS_SERIF" + | "SERIF" + | "MONOSPACED_SERIF" + | "CASUAL" + | "CURSIVE" + | "SMALL_CAPITALS"; + + type TextTrackFontStyle = "NORMAL" | "BOLD" | "BOLD_ITALIC" | "ITALIC"; + + type TextTrackEdgeType = + | "NONE" + | "OUTLINE" + | "DROP_SHADOW" + | "RAISED" + | "DEPRESSED"; + + type Command = + | "PAUSE" + | "SEEK" + | "STREAM_VOLUME" + | "STREAM_MUTE" + | "ALL_BASIC_MEDIA" + | "QUEUE_NEXT" + | "QUEUE_PREV" + | "QUEUE_SHUFFLE" + | "SKIP_AD"; + + type SeekResumeState = "PLAYBACK_START" | "PLAYBACK_PAUSE"; + + type StreamingProtocolType = + | "UNKNOWN" + | "MPEG_DASH" + | "HLS" + | "SMOOTH_STREAMING"; + + type StreamType = "BUFFERED" | "LIVE" | "NONE"; + + type FocusState = "IN_FOCUS" | "NOT_IN_FOCUS"; + + type ExtendedPlayerState = "LOADING"; + + type ErrorType = + | "INVALID_PLAYER_STATE" + | "LOAD_FAILED" + | "LOAD_CANCELLED" + | "INVALID_REQUEST" + | "ERROR"; + + type ErrorReason = + | "INVALID_COMMAND" + | "INVALID_PARAMS" + | "INVALID_MEDIA_SESSION_ID" + | "SKIP_LIMIT_REACHED" + | "NOT_SUPPORTED" + | "LANGUAGE_NOT_SUPPORTED" + | "END_OF_QUEUE" + | "APP_ERROR" + | "AUTHENTICATION_EXPIRED" + | "PREMIUM_ACCOUNT_REQUIRED" + | "CONCURRENT_STREAM_LIMIT" + | "PARENTAL_CONTROL_RESTRICTED" + | "NOT_AVAILABLE_IN_REGION" + | "CONTENT_ALREADY_PLAYING" + | "INVALID_REQUEST" + | "GENERIC_LOAD_ERROR"; + + type RepeatMode = + | "REPEAT_OFF" + | "REPEAT_ALL" + | "REPEAT_SINGLE" + | "REPEAT_ALL_AND_SHUFFLE"; + + type IdleReason = "CANCELLED" | "INTERRUPTED" | "FINISHED" | "ERROR"; + + type HlsSegmentFormat = "AAC" | "AC3" | "MP3" | "TS" | "TS_AAC"; + + type HdrType = "SDR" | "HDR" | "DV"; + + type PlayStringId = + | "FREE_TRIAL_ABOUT_TO_EXPIRE" + | "SUBSCRIPTION_ABOUT_TO_EXPIRE" + | "STREAM_HIJACKED"; + + type GetStatusOptions = "NO_METADATA" | "NO_QUEUE_ITEMS"; + + type MessageType = + | "MEDIA_STATUS" + | "CLOUD_STATUS" + | "QUEUE_CHANGE" + | "QUEUE_ITEMS" + | "QUEUE_ITEM_IDS" + | "GET_STATUS" + | "LOAD" + | "PAUSE" + | "STOP" + | "PLAY" + | "SKIP_AD" + | "PLAY_AGAIN" + | "SEEK" + | "SET_PLAYBACK_RATE" + | "SET_VOLUME" + | "EDIT_TRACKS_INFO" + | "EDIT_AUDIO_TRACKS" + | "PRECACHE" + | "PRELOAD" + | "QUEUE_LOAD" + | "QUEUE_INSERT" + | "QUEUE_UPDATE" + | "QUEUE_REMOVE" + | "QUEUE_REORDER" + | "QUEUE_NEXT" + | "QUEUE_PREV" + | "QUEUE_GET_ITEM_RANGE" + | "QUEUE_GET_ITEMS" + | "QUEUE_GET_ITEM_IDS" + | "QUEUE_SHUFFLE" + | "SET_CREDENTIALS" + | "LOAD_BY_ENTITY" + | "USER_ACTION" + | "DISPLAY_STATUS" + | "FOCUS_STATE" + | "CUSTOM_COMMAND"; + + type PlayerState = "IDLE" | "PLAYING" | "PAUSED" | "BUFFERING"; + + type QueueChangeType = + | "INSERT" + | "REMOVE" + | "ITEMS_CHANGE" + | "UPDATE" + | "NO_CHANGE"; + + type QueueType = + | "ALBUM" + | "PLAYLIST" + | "AUDIOBOOK" + | "RADIO_STATION" + | "PODCAST_SERIES" + | "TV_SERIES" + | "VIDEO_PLAYLIST" + | "LIVE_TV" + | "MOVIE"; + + type MetadataType = + | "GENERIC" + | "MOVIE" + | "TV_SHOW" + | "MUSIC_TRACK" + | "PHOTO"; + + /** + * RefreshCredentials request data. + */ + interface RefreshCredentialsRequestData { + [key: string]: any; + } + + /** + * Media event SET_VOLUME request data. + */ + interface VolumeRequestData extends RequestData { + /** + * The media stream volume + */ + volume?: Volume; + } + + /** + * Represents the volume of a media session stream. + */ + interface Volume { + /** + * Value from 0 to 1 that represents the current stream volume level. + */ + level?: number; + + /** + * Whether the stream is muted. + */ + muted?: boolean; + } + + /** + * Video information such as video resolution and High Dynamic Range (HDR). + */ + class VideoInformation { + constructor(width: number, height: number, hdrType: HdrType); + + width: number; + + height: number; + + hdrType: HdrType; + } + + /** + * VAST ad request configuration. + */ + interface VastAdsRequest { + /** + * Specifies a VAST document to be used as the ads response instead of making a + * request via an ad tag url. + * This can be useful for debugging and other situations where a VAST response is + * already available. + */ + adsResponse?: string; + + /** + * URL for VAST file. + */ + adTagUrl?: string; + } + + /** + * UserAction request data. + */ + interface UserActionRequestData { + /** + * Optional request source. + * It contain the assistent query that initiate the request. + */ + source?: string; + + /** + * User action to be handled by the application. + */ + userAction?: UserAction; + + /** + * Optional context information for the user action. + */ + userActionContext?: UserActionContext; + } + + /** + * A TV episode media description. + */ + interface TvShowMediaMetadata { + /** + * TV episode number. A positive integer. + */ + episode?: number; + + /** + * @deprecated use episode instead + */ + episodeNumber?: number; + + /** + * @deprecated use episode instead + */ + episodeTitle?: string; + + /** + * Content images. Examples would include cover art or a thumbnail of + * the currently playing media. + */ + images?: Image[]; + + /** + * ISO 8601 date when the episode originally aired; e.g. 2014-02-10. + */ + originalAirdate?: string; + + /** + * @deprecated use originalAirdate instead. + */ + releaseYear?: number; + + /** + * TV episode season. A positive integer. + */ + season?: number; + + /** + * @deprecated use season instead. + */ + seasonNumber?: number; + + /** + * TV series title. + */ + seriesTitle?: string; + + /** + * TV episode title. + */ + title?: string; + } + /** + * Describes track metadata information. + */ + class Track { + constructor(trackId: number, trackType: TrackType); + + /** + * Custom data set by the receiver application. + */ + customData?: string; + + /** + * Language tag as per RFC 5646 (If subtype is “SUBTITLES” it is mandatory). + */ + language?: string; + + /** + * A descriptive; human readable name for the track. For example "Spanish". + */ + name?: string; + + /** + * For text tracks; the type of text track. + */ + subtype?: string; + + /** + * It can be the url of the track or any other identifier that allows the receiver + * to find the content (when the track is not inband or included in the manifest). + * For example it can be the url of a vtt file. + */ + trackContentId?: string; + + /** + * It represents the MIME type of the track content. For example if the track + * is a vtt file it will be ‘text/vtt’. This field is needed for out of band tracks; + * so it is usually provided if a trackContentId has also been provided. + * It is not mandatory if the receiver has a way to identify the content from + * the trackContentId; but recommended. + * The track content type; if provided; must be consistent with the track type. + */ + trackContentType?: string; + + /** + * Unique identifier of the track within the context of a MediaInformation object. + */ + trackId?: number; + + /** + * The type of track. + */ + type: TrackType; + } + /** + * Describes style information for a text track. + */ + interface TextTrackStyle { + /** + * The background 32 bit RGBA color. The alpha channel should be used for transparent backgrounds. + */ + backgroundColor?: string; + + /** + * Custom data set by the receiver application. + */ + customData?: any; + + /** + * RGBA color for the edge; this value will be ignored if edgeType is NONE. + */ + edgeColor?: string; + + edgeType?: TextTrackEdgeType; + + /** + * If the font is not available in the receiver the fontGenericFamily will be used. + */ + fontFamily?: string; + + /** + * The text track generic family. + */ + fontGenericFamily?: TextTrackFontGenericFamily; + + /** + * The font scaling factor for the text track (the default is 1). + */ + fontScale?: number; + + /** + * The text track font style. + */ + fontStyle?: TextTrackFontStyle; + + /** + * The foreground 32 bit RGBA color. + */ + foregroundColor?: string; + + /** + * 32 bit RGBA color for the window. This value will be ignored if windowType is NONE. + */ + windowColor?: string; + + /** + * Rounded corner radius absolute value in pixels (px). This value will be ignored + * if windowType is not ROUNDED_CORNERS. + */ + windowRoundedCornerRadius?: number; + + /** + * The window concept is defined in CEA-608 and CEA-708. In WebVTT is called a region. + */ + windowType?: TextTrackWindowType; + } + + /** + * Media event playback rate request data. + */ + interface SetPlaybackRateRequestData extends RequestData { + /** + * New playback rate (>0). + */ + playbackRate?: number; + + /** + * New playback rate relative to current playback rate. + * New rate will be the result of multiplying the current rate with the value. + * For example a value of 1.1 will increase rate by 10%. + * (Only used if the playbackRate value is not provided). + */ + relativePlaybackRate?: number; + } + + /** + * SetCredentials request data. + */ + interface SetCredentialsRequestData { + /** + * Credentials to use by receiver. + */ + credentials?: string; + + /** + * If it is a response for refresh credentials; it will indicate the request id + * of the refresh credentials request. + */ + forRequestId?: number; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source?: string; + } + + /** + * Media event SEEK request data. + */ + interface SeekRequestData extends RequestData { + /** + * Seconds since beginning of content. + */ + currentTime?: number; + + /** + * Seconds relative to the current playback position. If this field is defined; + * the currentTime field will be ignored. + */ + relativeTime?: number; + + /** + * The playback state after a SEEK request. + */ + resumeState?: SeekResumeState; + } + + /** + * Provides seekable range in seconds. + */ + class SeekableRange { + constructor(start?: number, end?: number); + + /** + * End of the seekable range in seconds. + */ + end?: number; + + /** + * Start of the seekable range in seconds. + */ + start?: number; + } + + /** + * Media event request data. + */ + class RequestData { + constructor(type: MessageType); + + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + } + + /** + * Media event UPDATE queue request data. + */ + interface QueueUpdateRequestData { + /** + * ID of the current media Item after the deletion + * (if not provided; the currentItem value will be the same as before the deletion; + * if it does not exist because it has been deleted; the currentItem will point to + * the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like the + * QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * List of queue items to be updated. No reordering will happen; the items will + * retain the existing order. + */ + items?: QueueItem[]; + + /** + * Skip/Go back number of items with respect to the position of currentItem + * (it can be negative). If it is out of boundaries; the currentItem will be the + * next logical item in the queue wrapping around the boundaries. + * The new currentItem position will follow the rules of the queue repeat behavior. + */ + jump?: number; + + /** + * Behavior of the queue when all items have been played. + */ + repeatMode?: RepeatMode; + + /** + * Shuffle the queue items when the update is processed. + * After the queue items are shuffled; the item at the currentItem position will + * be loaded. + */ + shuffle?: boolean; + } + + /** + * Media event queue REORDER request data. + */ + class QueueReorderRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * ID of the current media Item after the deletion (if not provided; + * the currentItem value will be the same as before the deletion; + * if it does not exist because it has been deleted; + * the currentItem will point to the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like + * the QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * ID of the item that will be located immediately after the reordered list. + * If the ID is not found or it is not provided; + * the reordered list will be appended at the end of the existing list. + */ + insertBefore?: number; + + /** + * IDs of the items to be reordered; in the new order. + * Items not provided will keep their existing order. + * The provided list will be inserted at the position determined by insertBefore. + * For example: + * If insertBefore is not specified Existing queue: “A”;”D”;”G”;”H”;”B”;”E” itemIds: + * “D”;”H”;”B” New Order: “A”;”G”;”E”;“D”;”H”;”B” + * If insertBefore is “A” Existing queue: “A”;”D”;”G”;”H”;”B” itemIds: + * “D”;”H”;”B” New Order: “D”;”H”;”B”;“A”;”G”;”E” + * If insertBefore is “G” Existing queue: “A”;”D”;”G”;”H”;”B” itemIds: + * “D”;”H”;”B” New Order: “A”;“D”;”H”;”B”;”G”;”E” + */ + itemIds: number[]; + } + + /** + * Media event queue REMOVE request data. + */ + class QueueRemoveRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * ID of the current media Item after the deletion + * (if not provided; the currentItem value will be the same as before the deletion; + * if it does not exist because it has been deleted; + * the currentItem will point to the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like the + * QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * IDs of queue items to be deleted. + */ + itemIds?: number[]; + } + /** + * Media event queue LOAD request data. + */ + class QueueLoadRequestData extends RequestData { + constructor(items: QueueItem[]); + + /** + * Seconds (since the beginning of content) to start playback of the first item to + * be played. If provided; this value will take precedence over the + * startTime value provided at the QueueItem level but only the first + * time the item is played. This is to cover the common case where the user + * casts the item that was playing locally so the currentTime does not apply + * to the item permanently like the QueueItem startTime does. + * It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * Behavior of the queue when all items have been played. + */ + items: QueueItem[]; + + /** + * Id of the request; used to correlate request/response. + */ + repeatMode?: RepeatMode; + + /** + * The index of the item in the items array that must be the first currentItem + * (the item that will be played first). Note this is the index of the array + * (starts at 0) and not the itemId (as it is not known until the queue is created). + * If repeatMode is REPEAT_OFF playback will end when the last item in the array is + * played (elements before the startIndex will not be played). + * This may be useful for continuation scenarios where the user was already + * using the sender app and in the middle decides to cast. + * In this way the sender app does not need to map between the local and remote queue + * positions or saves one extra QUEUE_UPDATE request. + */ + startIndex?: number; + } + + /** + * Queue item information. Application developers may need to create a QueueItem to + * insert a queue element using InsertQueueItems. In this case they should not + * provide an itemId (as the actual itemId will be assigned when the item is inserted + * in the queue). This prevents ID collisions with items added from a sender app. + */ + class QueueItem { + constructor(opt_itemId?: number); + + /** + * Array of Track trackIds that are active. If the array is not provided; + * the default tracks will be active. + */ + activeTrackIds?: number[]; + + /** + * If the autoplay parameter is not specified or is true; the media player + * will begin playing the element in the queue when the item becomes the currentItem. + */ + autoplay?: boolean; + + /** + * The application can define any extra queue item information needed. + */ + customData?: any; + + /** + * Unique identifier of the item in the queue. + * The attribute is optional because for LOAD or INSERT should not be provided + * (as it will be assigned by the receiver when an item is first created/inserted). + */ + itemId?: number; + + /** + * Metadata (including contentId) of the playlist element. + */ + media?: MediaInformation; + + /** + * Playback duration of the item; if it is larger than the actual duration - + * startTime it will be ignored (default behavior). + * It can be negative; in such case the duration will be the actual asset + * duration minus the duration provided. + * It can be used for photo slideshows to control the duration the item should + * be presented or for live events to control the duration that the program + * should be played. It may be useful for autoplay scenarios to avoid displaying all + * the credits after an episode has ended. + */ + playbackDuration?: number; + + /** + * This parameter is a hint for the receiver to preload this media + * item before it is played. It allows for a smooth transition between items + * played from the queue. The time is expressed in seconds; relative to + * the beginning of this item playback (usually the end of the previous item playback). + * Only positive values are valid. For example; if the value is 10 seconds; this item + * will be preloaded 10 seconds before the previous item has finished. + * The receiver will try to honor this value but will not guarantee it; + * for example if the value is larger than the previous item duration the + * receiver may just preload this item shortly after the previous item has started playing + * (there will never be two items being preloaded in parallel). + * Also; if an item is inserted in the queue just after the currentItem and the time to preload is higher than the + * time left on the currentItem; the preload will just happen as soon as possible. + */ + preloadTime?: number; + + /** + * Seconds since beginning of content. If the content is live content; + * and startTime is not specified; the stream will start at the live position. + */ + startTime?: number; + } + + /** + * Media event queue INSERT request data. + */ + class QueueInsertRequestData extends RequestData { + constructor(items: QueueItem[]); + + /** + * ID of the current media Item after the insertion (if not provided; + * the currentItem value will be the same as before the insertion). + */ + currentItemId?: number; + + /** + * Index (relative to the items array; starting with 0) of the new current media Item. + * For inserted items we use the index (similar to startIndex in QUEUE_LOAD) and not + * currentItemId; because the itemId is unknown until the items are inserted. + * If not provided; the currentItem value will be the same as before the insertion + * (unless currentItemId is provided). This param allows to make atomic the common use + * case of insert and play an item. + */ + currentItemIndex?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like the + * QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * ID of the item that will be located immediately after the inserted list. + * If the ID is not found or it is not provided; the list will be appended at + * the end of the existing list. + */ + insertBefore?: number; + + /** + * List of queue items. The itemId field of the items should be empty. + * It is sorted (first element will be played first). + */ + items: QueueItem[]; + } + + /** + * Represents a data message containing the full list of queue ids. + */ + interface QueueIds { + /** + * List of queue item ids. + */ + itemIds?: number[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + type: MessageType; + } + + /** + * Queue data as part of the LOAD request. + */ + class QueueData { + constructor( + id?: string, + name?: string, + description?: string, + repeatMode?: RepeatMode, + items?: QueueItem[], + startIndex?: number, + startTime?: number + ); + + /** + * Description of the queue. + */ + description?: string; + + /** + * Optional Queue entity id; provide Google Assistant deep link. + */ + entity?: string; + + /** + * Id of the queue. + */ + id?: string; + + /** + * Array of queue items. It is sorted (first element will be played first). + */ + items?: QueueItem[]; + + /** + * Name of the queue. + */ + name?: string; + + /** + * Queue type; e.g. album; playlist; radio station; tv series; etc. + */ + queueType?: QueueType; + + /** + * Continuous playback behavior of the queue. + */ + repeatMode?: RepeatMode; + + /** + * The index of the item in the queue that should be used to start playback first. + */ + startIndex?: number; + + /** + * Seconds (since the beginning of content) to start playback of the first item. + */ + startTime?: number; + } + + /** + * Represents a queue change message; such as insert; remove; and update. + */ + interface QueueChange { + /** + * The actual queue change type. + */ + changeType?: QueueChangeType; + + /** + * The id to insert the list of itemIds before. + */ + insertBefore?: number; + + /** + * List of changed itemIds. + */ + itemIds?: number[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + /** + * The queue change sequence ID. Used to coordinate state sync between various + * senders and the receiver. + */ + sequenceNumber?: number; + + type: MessageType; + } + + /** + * Media event PRELOAD request data. + */ + class PreloadRequestData implements LoadRequestData { + /** + * Array of trackIds that are active. If the array is not provided; + * the default tracks will be active. + */ + activeTrackIds: number[]; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified;the media player + * implementation may choose to begin playback immediately. + */ + autoplay?: boolean; + /** + * Optional user credentials. + */ + credentials?: string; + /** + * Optional credentials type. The type 'cloud' is a reserved type used by load + * requests that were originated by voice assistant commands. + */ + credentialsType?: string; + /** + * Seconds since beginning of content. If the content is live content; + * and currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified; the media + * player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + /** + * The media playback rate. + */ + playbackRate?: number; + /** + * Queue data. + */ + queueData: QueueData; + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + constructor(itemId: number); + + /** + * The ID of the queue item. + */ + itemId: number; + } + + /** + * Media event PRECACHE request data. (Some fields of the load request; + * like autoplay and queueData; are ignored). + */ + class PrecacheRequestData implements LoadRequestData { + /** + * Array of trackIds that are active. If the array is not provided; + * the default tracks will be active. + */ + activeTrackIds: number[]; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified;the media player + * implementation may choose to begin playback immediately. + */ + autoplay?: boolean; + /** + * Optional user credentials. + */ + credentials?: string; + /** + * Optional credentials type. The type 'cloud' is a reserved type used by load + * requests that were originated by voice assistant commands. + */ + credentialsType?: string; + /** + * Seconds since beginning of content. If the content is live content; and + * currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified; + * the media player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + /** + * The media playback rate. + */ + playbackRate?: number; + /** + * Queue data. + */ + queueData: QueueData; + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + constructor(data?: string); + + /** + * Application precache data. + */ + precacheData?: string; + } + + /** + * PlayString request data. + */ + class PlayStringRequestData { + constructor(stringId: PlayStringId, opt_arguments?: string[]); + + /** + * An optional array of string values to be filled into the text. + */ + arguments?: string[]; + + /** + * An identifier for the text to be played back. + */ + stringId: PlayStringId; + } + + /** + * A photo media description. + */ + interface PhotoMediaMetadata { + /** + * Name of the photographer. + */ + artist?: string; + + /** + * ISO 8601 date and time the photo was taken; e.g. 2014-02-10T15:47:00Z. + */ + creationDateTime?: string; + + /** + * Photo height; in pixels. + */ + height?: number; + + /** + * Images associated with the content. Examples would include a photo thumbnail. + */ + images: Image[]; + + /** + * Latitude. + */ + latitude?: number; + + /** + * Location where the photo was taken. For example; "Seattle; Washington; USA". + */ + location?: string; + + /** + * Longitude. + */ + longitude?: number; + + /** + * Photo title. + */ + title?: string; + + /** + * Photo width; in pixels. + */ + width?: number; + } + + /** + * A music track media description. + */ + interface MusicTrackMediaMetadata { + /** + * Album artist name. + */ + albumArtist?: string; + + /** + * Album name. + */ + albumName?: string; + + /** + * Track artist name. + */ + artist?: string; + + /** + * @deprecated: use @see{@link artist} instead + */ + artistName: string; + + /** + * Track composer name. + */ + composer?: string; + + /** + * Disc number. A positive integer. + */ + discNumber?: number; + + /** + * Content images. Examples would include cover art or a thumbnail of the + * currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date when the track was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated: Use @see{@link releaseDate} instead + */ + releaseYear?: string; + + /** + * Track name. + */ + songName?: string; + + /** + * Track title. + */ + title?: string; + + /** + * Track number in album. A positive integer. + */ + trackNumber?: number; + } + + /** + * A movie media description. + */ + interface MovieMediaMetadata { + /** + * Content images. Examples would include cover art or a thumbnail of the + * currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date when the movie was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated: use @see{@link releaseDate} instead + */ + releaseYear?: number; + + /** + * Movie studio. + */ + studio?: string; + + /** + * Movie subtitle. + */ + subtitle?: string; + + /** + * Movie title. + */ + title?: string; + } + /** + * Represents the status of a media session. + */ + interface MediaStatus { + /** + * List of IDs corresponding to the active tracks. + */ + activeTrackIds: number[]; + + /** + * Status of break; if receiver is playing break. + * This field will be defined only when receiver is playing break. + */ + breakStatus: BreakStatus; + + /** + * ID of this media item (the item that originated the status change). + */ + currentItemId?: number; + + /** + * The current playback position. + */ + currentTime: number; + + /** + * Application-specific media status. + */ + customData?: any; + + /** + * Extended media status information. + */ + extendedStatus: ExtendedMediaStatus; + + /** + * If the state is IDLE; the reason the player went to IDLE state. + */ + idleReason: IdleReason; + + /** + * List of media queue items. + */ + items: QueueItem[]; + + /** + * Seekable range of a live or event stream. It uses relative media time in seconds. + * It will be undefined for VOD streams. + */ + liveSeekableRange: LiveSeekableRange; + + /** + * ID of the media Item currently loading. If there is no item being loaded; + * it will be undefined. + */ + loadingItemId?: number; + + /** + * The media information. + */ + media: MediaInformation; + + /** + * Unique id for the session. + */ + mediaSessionId: number; + + /** + * The playback rate. + */ + playbackRate: number; + + /** + * The playback state. + */ + playerState: PlayerState; + + /** + * ID of the next Item; only available if it has been preloaded. + * Media items can be preloaded and cached temporarily in memory; + * so when they are loaded later on; the process is faster + * (as the media does not have to be fetched from the network). + */ + preloadedItemId?: number; + + /** + * Queue data. + */ + queueData: QueueData; + + /** + * The behavior of the queue when all items have been played. + */ + repeatMode: RepeatMode; + + /** + * The commands supported by this player. + */ + supportedMediaCommands: number; + + type: MessageType; + + /** + * The video information. + */ + videoInfo: VideoInformation; + + /** + * The current stream volume. + */ + volume: Volume; + } + /** + * Common media metadata used as part of MediaInformation + */ + class MediaMetadata { + constructor(type: MetadataType); + + /** + * The type of metadata + */ + metadataType: MetadataType; + } + + /** + * Represents the media information. + */ + interface MediaInformation { + /** + * Partial list of break clips that includes current break clip that receiver + * is playing or ones that receiver will play shortly after; instead of sending + * whole list of clips. This is to avoid overflow of MediaStatus message. + */ + breakClips: BreakClip[]; + + /** + * List of breaks. + */ + breaks: Break[]; + + /** + * Typically the url of the media. + */ + contentId: string; + + /** + * The content MIME type. + */ + contentType: string; + + /** + * Optional media url; to allow using contentId for real id. If contentUrl + * is provided; it will be used as media url; otherwise the contentId will + * be used as the media url. + */ + contentUrl?: string; + + /** + * Application-specific media information. + */ + customData?: any; + + /** + * The media duration. + */ + duration?: number; + + /** + * Optional Media entity; provide Google Assistant deep link. + */ + entity?: string; + + /** + * The format of the HLS media segment. + */ + hlsSegmentFormat: HlsSegmentFormat; + + /** + * The media metadata. + */ + metadata: MediaMetadata; + + /** + * The stream type. + */ + streamType: StreamType; + + /** + * The style of text track. + */ + textTrackStyle: TextTrackStyle; + + /** + * The media tracks. + */ + tracks: Track[]; + } + + /** + * Media event LOAD request data. + */ + interface LoadRequestData extends RequestData { + /** + * Array of trackIds that are active. If the array is not provided; the + * default tracks will be active. + */ + activeTrackIds: number[]; + + /** + * If the autoplay parameter is specified; the media player will begin + * playing the content when it is loaded. Even if autoplay is not + * specified;the media player implementation may choose to begin playback + * immediately. + */ + autoplay?: boolean; + + /** + * Optional user credentials. + */ + credentials?: string; + + /** + * Optional credentials type. The type 'cloud' is a reserved type used by + * load requests that were originated by voice assistant commands. + */ + credentialsType?: string; + + /** + * Seconds since beginning of content. If the content is live content; + * and currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified; the media + * player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + + /** + * The media playback rate. + */ + playbackRate?: number; + + /** + * Queue data. + */ + queueData: QueueData; + } + + /** + * LoadByEntity request data. + */ + interface LoadByEntityRequestData { + /** + * Content entity information; typically represented by a stringified JSON object + */ + entity: string; + + /** + * Shuffle the items to play. + */ + shuffle?: boolean; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source?: string; + } + + /** + * Provides live seekable range with start and end time in seconds and two more + * attributes. + */ + class LiveSeekableRange { + constructor( + start?: number, + end?: number, + isMovingWindow?: boolean, + isLiveDone?: boolean + ); + + /** + * A boolean value indicates whether a live stream is ended. If it is done; + * the end of live seekable range should stop updating. + */ + isLiveDone?: boolean; + + /** + * A boolean value indicates whether the live seekable range is a moving window. + * If false; it will be either a expanding range or a fixed range meaning live + * has ended. + */ + isMovingWindow?: boolean; + } + + /** + * Represents a data message containing item information for each requested ids. + */ + interface ItemsInfo { + /** + * List of changed itemIds. + */ + items: QueueItem[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + type: MessageType; + } + + /** + * An image that describes a receiver application or media item. + * This could be an application icon; cover art; or a thumbnail. + */ + class Image { + constructor(url: string); + + /** + * The height of the image. + */ + height?: number; + + /** + * the URL to the image + */ + url: string; + + /** + * The width of the image + */ + width?: number; + } + /** Media event GET_STATUS request data. */ + interface GetStatusRequestData extends RequestData { + /** + * The options of a GET_STATUS request. + */ + options: GetStatusOptions; + } + + /** + * Get items info request data. + */ + class GetItemsInfoRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * List of item ids to be requested. + */ + itemIds: number[]; + } + /** + * A generic media description. + */ + interface GenericMediaMetadata extends MediaMetadata { + /** + * Content images. Examples would include cover art or a thumbnail of the + * currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date and/or time when the content was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated - use @see{@link releaseDate} instead + */ + releaseYear?: number; + + /** + * Content subtitle. + */ + subtitle?: string; + + /** + * Content title. + */ + title?: string; + } + + /** + * Focus state change message. + */ + interface FocusStateRequestData { + /** + * The focus state of the app. + */ + state: FocusState; + } + + /** Fetch items request data. */ + class FetchItemsRequestData extends RequestData { + constructor(itemId: number, nextCount: number, prevCount: number); + + /** + * ID of the reference media item for fetching more items. + */ + itemId: number; + + /** + * Number of items after the reference item to be fetched. + */ + nextCount: number; + + /** + * Number of items before the reference item to be fetched. + */ + prevCount: number; + } + + /** + * Extended media status information + */ + class ExtendedMediaStatus { + constructor( + playerState: MediaInformation, + opt_media?: MediaInformation + ); + + media: MediaInformation; + + playerState: ExtendedPlayerState; + } + + /** Event data for @see{@link EventType.ERROR} event. */ + class ErrorEvent extends Event { + constructor(detailedErrorCode?: DetailedErrorCode, error?: any); + + /** + * An error code representing the cause of the error. + */ + detailedErrorCode?: DetailedErrorCode; + + /** + * The error object. + * This could be an Error object (e.g.; if an Error was thrown in an event handler) + * or an object with error information (e.g.; if the receiver received an invalid + * command). + */ + error?: any; + } + + class ErrorData { + constructor(type: ErrorType); + + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + + /** + * Id of the request; used to correlate request/response. + */ + requestId?: number; + } + + /** Media event EDIT_TRACKS_INFO request data. */ + interface EditTracksInfoRequestData extends RequestData { + /** + * Array of the Track trackIds that should be active. + * If it is not provided; the active tracks will not change. + * If the array is empty; no track will be active. + */ + activeTrackIds?: number[]; + + /** + * Flag to enable or disable text tracks. + * If false it will disable all text tracks; + * if true it will enable the first text track; or the previous active text tracks. + * This flag is ignored if activeTrackIds or language is provided. + */ + enableTextTracks?: boolean; + + /** + * Indicates that the provided language was not explicit user request; but rather + * inferred from used language in voice query. + * It allows receiver apps to use user saved preference instead of spoken language. + */ + isSuggestedLanguage?: boolean; + + /** + * Language for the tracks that should be active. The language field will take + * precedence over activeTrackIds if both are specified. + */ + language?: string; + + textTrackStyle?: TextTrackStyle; + } + + /** + * Media event EDIT_AUDIO_TRACKS request data. If language is not provided; + * the default audio track for the media will be enabled. + */ + interface EditAudioTracksRequestData extends RequestData { + /** + * Indicates that the provided language was not explicit user request; + * but rather inferred from used language in voice query. + * It allows receiver apps to use user saved preference instead of spoken language. + */ + isSuggestedLanguage?: boolean; + + language?: string; + } + + /** DisplayStatus request data. */ + interface DisplayStatusRequestData { + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source: string; + } + + /** CustomCommand request data. */ + interface CustomCommandRequestData { + /** + * Custom Data; typically represented by a stringified JSON object. + */ + data: string; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source: string; + } + + class BreakStatus { + constructor(currentBreakTime: number, currentBreakClipTime: number); + + /** + * Id of current break clip. + */ + breakClipId: string; + + /** + * Id of current break. + */ + breakId: string; + + /** + * Time in sec elapsed after current break clip starts. + */ + currentBreakClipTime: number; + + /** + * Time in sec elapsed after current break starts. + */ + currentBreakTime: number; + + /** + * The time in sec when this break clip becomes skippable. + * 5 means that end user can skip this break clip after 5 seconds. + * If this field is not defined; it means that current break clip is not skippable. + */ + whenSkippable: number; + } + + /** + * Represents break clip (e.g. a clip of ad during ad break) + */ + class BreakClip { + constructor(id: string); + + /** + * Url of page that sender will display; when end user clicks link on sender UI; while receiver is playing this clip. + */ + clickThroughUrl?: string; + /** + * Typically the url of the break media (playing on the receiver). + */ + contentId?: string; + /** + * The content MIME type. + */ + contentType?: string; + /** + * Optional break media url; to allow using contentId for real id. + * If contentUrl is provided; it will be used as media url; + * otherwise the contentId will be used as the media url. + */ + contentUrl?: string; + /** + * Application-specific break clip data. + */ + customData?: any; + /** + * Duration of break clip in sec. + */ + duration?: number; + /** + * The format of the HLS media segment. + */ + hlsSegmentFormat?: HlsSegmentFormat; + /** + * Unique id of break clip. + */ + id: string; + /** + * Url of content that sender will display while receiver is playing this clip. + */ + posterUrl?: string; + /** + * Title of break clip. Sender might display this on its screen; if provided. + */ + title?: string; + /** + * VAST ad request configuration. Used if contentId or contentUrl is not provided. + */ + vastAdsRequest?: VastAdsRequest; + /** + * The time in sec when this break clip becomes skippable. + * 5 means that end user can skip this break clip after 5 seconds. + * If this field is not defined; it means that current break clip is not skippable. + */ + whenSkippable?: number; + } + + /** Represents break (e.g. ad break) included in main video. */ + class Break { + constructor(id: string, breakClipIds: string[], position: number); + /** + * List of ids of break clip that this break includes. + */ + breakClipIds: string[]; + /** + * Duration of break in sec. + */ + duration?: number; + /** + * Unique id of break. + */ + id: string; + /** + * If true; indicates this is embedded break in main stream. + */ + + isEmbedded?: boolean; + /** + * Whether break is watched. + * Sender can change color of progress bar marker corresponding to this break once + * this field changes from false to true; + * denoting that the end-user already watched this break. + */ + isWatched: boolean; + + /** + * Where the break is located inside main video. -1 represents the end of main video. + */ + position: number; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.system.d.ts b/types/chromecast-caf-receiver/cast.framework.system.d.ts new file mode 100644 index 0000000000..d055e252fb --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.system.d.ts @@ -0,0 +1,198 @@ +import { EventType } from "./cast.framework.events"; +export = cast.framework.system; + +declare namespace cast.framework.system { + type EventType = + // Fired when the system is ready. + | "READY" + // Fired when the application is terminated + | "SHUTDOWN" + // Fired when a new sender has connected. + | "SENDER_CONNECTED" + // Fired when a sender has disconnected. + | "SENDER_DISCONNECTED" + // Fired when there is a system error. + | "ERROR" + // Fired when the system volume has changed. + | "SYSTEM_VOLUME_CHANGED" + // Fired when the visibility of the application has changed + // (for example after a HDMI Input change or when the TV is turned + // off/on and the cast device is externally powered). + // Note that this API has the same effect as the webkitvisibilitychange event raised + // by your document, we provided it as CastReceiverManager API for convenience and + // to avoid a dependency on a webkit-prefixed event. + | "VISIBILITY_CHANGED" + // Fired when the standby state of the TV has changed. + // This event is related to the visibility chnaged event, as if the TV is in standby + // the visibility will be false, the visibility is more granular + // (as it also detects that the TV has selected a different channel) + // but it is not reliably detected in all TVs, + // standby can be used in those cases as most TVs implement it. + | "STANDBY_CHANGED" + | "MAX_VIDEO_RESOLUTION_CHANGED" + | "FEEDBACK_STARTED"; + + type SystemState = + | "NOT_STARTED" + | "STARTING_IN_BACKGROUND" + | "STARTING" + | "READY" + | "STOPPING_IN_BACKGROUND" + | "STOPPING"; + + type StandbyState = "STANDBY" | "NOT_STANDBY" | "UNKNOWN"; + + type DisconnectReason = "REQUESTED_BY_SENDER" | "ERROR" | "UNKNOWN"; + + /** + * Event dispatched by @see{@link CastReceiverManager} when the visibility of the application changes (HDMI input change; TV is turned off). + */ + class VisibilityChangedEvent { + constructor(isVisible: boolean); + + /** + * Whether the Cast device is the active input or not. + */ + isVisible: boolean; + } + + /** + * Represents the system volume data. + */ + interface SystemVolumeData { + /** + * The level (from 0.0 to 1.0) of the system volume + */ + level: number; + + /** + * Whether the system volume is muted or not. + */ + muted: boolean; + } + /** + * Event dispatched by @see{CastReceiverManager} when the system volume changes. + */ + class SystemVolumeChangedEvent extends Event { + constructor(volume: SystemVolumeData); + + /** + * The system volume data + */ + data: SystemVolumeData; + } + /** + * Event dispatched by @see{@link CastReceiverManager} when the TV enters/leaves the standby state. + */ + class StandbyChangedEvent { + constructor(isStandby: boolean); + + isStandby: boolean; + } + /** + * Whether the TV is in standby or not. + */ + interface ShutdownEvent extends Event { + [key: string]: any; + } + + /** + * Event dispatched by @see{@link CastReceiverManager} when a sender is disconnected. + */ + class SenderDisconnectedEvent extends Event { + constructor(senderId: string, userAgent: string); + /** + * The ID of the sender connected. + */ + senderId: string; + + /** + * The user agent of the sender. + */ + userAgent: string; + + /** + * The reason the sender was disconnected. + */ + reason?: DisconnectReason; + } + + /** + * Event dispatched by @see{@link CastReceiverManager} when a sender is connected. + */ + class SenderConnectedEvent extends Event { + constructor(senderId: string, userAgent: string); + /** + * The ID of the sender connected. + */ + senderId: string; + + /** + * The user agent of the sender. + */ + userAgent: string; + } + + /** + * Represents the data of a connected sender device. + */ + interface Sender { + /** + * The sender Id. + */ + id: string; + + /** + * Indicate the sender supports large messages (>64KB) + */ + largeMessageSupported?: boolean; + + /** + * The userAgent of the sender. + */ + userAgent?: string; + } + + /** + * Event dispatched by CastReceiverManager when the system is ready. + */ + class ReadyEvent { + constructor(applicationData: ApplicationData); + + /** + * The application data + */ + data: ApplicationData; + } + + /** + * Event dispatched by @see{@link CastReceiverManager} when the system needs to update the restriction on maximum video resolution. + */ + class MaxVideoResolutionChangedEvent extends Event { + constructor(height: number); + + /** + * Maximum video resolution requested by the system. The value of 0 means there is no restriction. + */ + height: number; + } + /** Event dispatched by @see{@link CastReceiverManager} when the systems starts to create feedback report. */ + interface FeedbackStartedEvent extends Event { + [key: string]: any; + } + /** Event dispatched by @see{@link CastReceiverContext} which contains system information. */ + class Event { + constructor(type: EventType, data?: any); + type: EventType; + data?: any; + } + + /** Represents the data of the launched application. */ + interface ApplicationData { + id(): string; + launchingSenderId(): string; + name(): string; + namespaces(): string[]; + sessionId(): number; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.ui.d.ts b/types/chromecast-caf-receiver/cast.framework.ui.d.ts new file mode 100644 index 0000000000..77d93c8082 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.ui.d.ts @@ -0,0 +1,197 @@ +import { PlayerDataEventType } from "./cast.framework.ui"; +import { MediaMetadata } from "./cast.framework.messages"; +import { PlayerDataChangedEventHandler } from "./index"; + +export = cast.framework.ui; + +declare namespace cast.framework.ui { + type ContentType = "video" | "audio" | "image"; + + type State = + | "launching" + | "idle" + | "loading" + | "buffering" + | "paused" + | "playing"; + + type PlayerDataEventType = + | "ANY_CHANGE" + | "STATE_CHANGED" + | "IS_SEEKING_CHANGED" + | "DURATION_CHANGED" + | "CURRENT_TIME_CHANGED" + | "METADATA_CHANGED" + | "TITLE_CHANGED" + | "SUBTITLE_CHANGED" + | "THUMBNAIL_URL_CHANGED" + | "NEXT_TITLE_CHANGED" + | "NEXT_SUBTITLE_CHANGED" + | "NEXT_THUMBNAIL_URL_CHANGED" + | "PRELOADING_NEXT_CHANGED" + | "CONTENT_TYPE_CHANGED" + | "IS_LIVE_CHANGED" + | "BREAK_PERCENTAGE_POSITIONS_CHANGED" + | "IS_PLAYING_BREAK_CHANGED" + | "IS_BREAK_SKIPPABLE_CHANGED" + | "WHEN_SKIPPABLE_CHANGED" + | "NUMBER_BREAK_CLIPS_CHANGED" + | "CURRENT_BREAK_CLIP_NUMBER_CHANGED" + | "DISPLAY_STATUS_CHANGED"; + + /** + * Player data changed event. Provides the changed field (type); and new value. + */ + class PlayerDataChangedEvent { + constructor(type: PlayerDataEventType, field: string, value: any); + + /** + * The field name that was changed. + */ + field: string; + + type: PlayerDataEventType; + + /** + * The new field value. + */ + value: any; + } + /** + * Player data binder. Bind a player data object to the player state. + * The player data will be updated to reflect correctly the current player state without firing any change event. + */ + class PlayerDataBinder { + constructor(playerData: PlayerData); + + /** + * Add listener to player data changes. + */ + addEventListener: ( + type: PlayerDataEventType, + listener: PlayerDataChangedEventHandler + ) => void; + + /** + * Remove listener to player data changes. + */ + removeEventListener: ( + type: PlayerDataEventType, + listener: PlayerDataChangedEventHandler + ) => void; + } + /** + * Player data. Provide the player media and break state. + */ + interface PlayerData { + /** + * Array of breaks positions in percentage. + */ + breakPercentagePositions: number[]; + + /** + * Content Type. + */ + contentType: ContentType; + + /** + * The number of the current playing break clip in the break. + */ + currentBreakClipNumber: number; + + /** + * Media current position in seconds; or break current position if playing break. + */ + currentTime: number; + + /** + * Whether the player metadata (ie: title; currentTime) should be displayed. + * This will be true if at least one field in the metadata should be displayed. + * In some cases; displayStatus will be true; but parts of the metadata should be hidden + * (ie: the media title while media is seeking). + * In these cases; additional css can be applied to hide those elements. + * For cases where the media is audio-only; this will almost always be true. + * In cases where the media is video; this will be true when: + * (1) the video is loading; buffering; or seeking + * (2) a play request was made in the last five seconds while media is already playing; + * (3) there is a request made to show the status in the last five seconds; or + * (4) the media was paused in the last five seconds. + */ + displayStatus: boolean; + + /** + * Media duration in seconds; Or break duration if playing break. + */ + duration: number; + + /** + * Indicate break clip can be skipped. + */ + isBreakSkippable: boolean; + + /** + * Indicate if the content is a live stream. + */ + isLive: boolean; + + /** + * Indicate that the receiver is playing a break. + */ + isPlayingBreak: boolean; + + /** + * Indicate the player is seeking (can be either during playing or pausing). + */ + isSeeking: boolean; + + /** + * Media metadata. + */ + metadata: MediaMetadata; + + /** + * Next Item subtitle. + */ + nextSubtitle: string; + + /** + * Next Item thumbnail url. + */ + nextThumbnailUrl: string; + + /** + * Next Item title. + */ + nextTitle: string; + + /** + * Number of break clips in current break. + */ + numberBreakClips: number; + + /** + * Flag to show/hide next item metadata. + */ + preloadingNext: boolean; + + /** + * Current player state. + */ + state: State; + + /** + * Content thumbnail url. + */ + thumbnailUrl: string; + + /** + * Content title. + */ + title: string; + + /** + * Provide the time a break is skipable - relative to current playback time. Undefined if not skippable. + */ + whenSkippable?: number; + } +} diff --git a/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts new file mode 100644 index 0000000000..a75834b0a8 --- /dev/null +++ b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts @@ -0,0 +1,106 @@ +import { + PlayerData, + PlayerDataBinder +} from "chromecast-caf-receiver/cast.framework.ui"; +import { + ReadyEvent, + ApplicationData +} from "chromecast-caf-receiver/cast.framework.system"; +import { + RequestEvent, + Event +} from "chromecast-caf-receiver/cast.framework.events"; +import { + QueueBase, + TextTracksManager, + QueueManager, + PlayerManager +} from "chromecast-caf-receiver/cast.framework"; +import { + BreakSeekData, + BreakClipLoadInterceptorContext, + BreakManager +} from "chromecast-caf-receiver/cast.framework.breaks"; +import { + Break, + BreakClip, + LoadRequestData, + Track, + MediaMetadata +} from "chromecast-caf-receiver/cast.framework.messages"; + +const track = new Track(1, "TEXT"); +const breakClip = new BreakClip("id"); +const adBreak = new Break("id", ["id"], 1); +const rEvent = new RequestEvent("BITRATE_CHANGED", { requestId: 2 }); +const pManager = new PlayerManager(); +pManager.addEventListener("STALLED", () => {}); +const ttManager = new TextTracksManager(); +const qManager = new QueueManager(); +const qBase = new QueueBase(); +const items = qBase.fetchItems(1, 3, 4); +const breakSeekData = new BreakSeekData(0, 100, []); +const breakClipLoadContext = new BreakClipLoadInterceptorContext(adBreak); +const breakManager: BreakManager = { + getBreakById: () => adBreak, + getBreakClipById: () => breakClip, + getBreakClips: () => [breakClip], + getBreaks: () => [adBreak], + getPlayWatchedBreak: () => true, + setBreakClipLoadInterceptor: () => {}, + setBreakSeekInterceptor: () => {}, + setPlayWatchedBreak: () => {}, + setVastTrackingInterceptor: () => {} +}; + +const lrd: LoadRequestData = { + requestId: 1, + activeTrackIds: [1, 2], + media: { + tracks: [], + textTrackStyle: {}, + streamType: "BUFFERED", + metadata: { metadataType: "GENERIC" }, + hlsSegmentFormat: "AAC", + contentId: "id", + contentType: "type", + breakClips: [breakClip], + breaks: [adBreak] + }, + queueData: {} +}; + +const appData: ApplicationData = { + id: () => "id", + launchingSenderId: () => "launch-id", + name: () => "name", + namespaces: () => ["namespace"], + sessionId: () => 1 +}; + +const readyEvent = new ReadyEvent(appData); +const data = readyEvent.data; +const pData: PlayerData = { + breakPercentagePositions: [1], + contentType: "video", + currentBreakClipNumber: 2, + currentTime: 1234, + displayStatus: true, + duration: 222, + isBreakSkippable: false, + isLive: true, + isPlayingBreak: false, + isSeeking: true, + metadata: new MediaMetadata("GENERIC"), + nextSubtitle: "sub", + nextThumbnailUrl: "url", + nextTitle: "title", + numberBreakClips: 3, + preloadingNext: false, + state: "paused", + thumbnailUrl: "url", + title: "title", + whenSkippable: 321 +}; +const binder = new PlayerDataBinder(pData); +binder.addEventListener("ANY_CHANGE", e => {}); diff --git a/types/chromecast-caf-receiver/index.d.ts b/types/chromecast-caf-receiver/index.d.ts new file mode 100644 index 0000000000..73a13f53ca --- /dev/null +++ b/types/chromecast-caf-receiver/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://github.com/googlecast +// Definitions by: Craig Bruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// +/// +/// +/// +/// +/// + +import { PlayerDataChangedEvent } from './cast.framework.ui'; +import { NetworkRequestInfo } from './cast.framework'; +import { Event } from './cast.framework.events'; + +export as namespace cast; +export type EventHandler = (event: Event) => void; +export type PlayerDataChangedEventHandler = ( + event: PlayerDataChangedEvent +) => void; +export type RequestHandler = (request: NetworkRequestInfo) => void; +export type BinaryHandler = (data: Uint8Array) => Uint8Array; diff --git a/types/chromecast-caf-receiver/tsconfig.json b/types/chromecast-caf-receiver/tsconfig.json new file mode 100644 index 0000000000..452dd41e91 --- /dev/null +++ b/types/chromecast-caf-receiver/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": false, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "chromecast-caf-receiver-tests.ts", + "cast.framework.d.ts", + "cast.framework.breaks.d.ts", + "cast.framework.events.d.ts", + "cast.framework.messages.d.ts", + "cast.framework.system.d.ts", + "cast.framework.ui.d.ts" + ] +} diff --git a/types/chromecast-caf-receiver/tslint.json b/types/chromecast-caf-receiver/tslint.json new file mode 100644 index 0000000000..495d29983d --- /dev/null +++ b/types/chromecast-caf-receiver/tslint.json @@ -0,0 +1,5 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + } +} diff --git a/types/devexpress-aspnetcore-bootstrap/devexpress-aspnetcore-bootstrap-tests.ts b/types/devexpress-aspnetcore-bootstrap/devexpress-aspnetcore-bootstrap-tests.ts new file mode 100644 index 0000000000..55eae3c27f --- /dev/null +++ b/types/devexpress-aspnetcore-bootstrap/devexpress-aspnetcore-bootstrap-tests.ts @@ -0,0 +1,13 @@ +declare let button: DevExpress.AspNetCore.BootstrapButton; +button.on('click', e => {}); +button.doClick(); +button.once('click', e => {}); + +declare let accordion: DevExpress.AspNetCore.BootstrapAccordion; +accordion.on('init', e => {}); +const firstGroup = accordion.getGroup(0); +if (firstGroup) { + const groupText = firstGroup.getText(); + const item = firstGroup.getItemByName('item10'); + item && item.getEnabled(); +} diff --git a/types/devexpress-aspnetcore-bootstrap/index.d.ts b/types/devexpress-aspnetcore-bootstrap/index.d.ts new file mode 100644 index 0000000000..51d1c2ebb4 --- /dev/null +++ b/types/devexpress-aspnetcore-bootstrap/index.d.ts @@ -0,0 +1,2496 @@ +// Type definitions for DevExpress ASP.NET 181.3 +// Project: http://devexpress.com/ +// Definitions by: DevExpress Inc. +// Andrey Skubarenko +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +declare namespace DevExpress.AspNetCore { + enum BootstrapSchedulerGroupType { + Date = "Date", + None = "None", + Resource = "Resource", + } + enum BootstrapSchedulerViewType { + Day = "Day", + WorkWeek = "WorkWeek", + Week = "Week", + Month = "Month", + Timeline = "Timeline", + FullWeek = "FullWeek", + Agenda = "Agenda", + } + enum BootstrapSchedulerAppointmentType { + Normal = "Normal", + Pattern = "Pattern", + Occurrence = "Occurrence", + ChangedOccurrence = "ChangedOccurrence", + DeletedOccurrence = "DeletedOccurrence", + } + enum BootstrapSchedulerRecurrenceRange { + NoEndDate = "NoEndDate", + OccurrenceCount = "OccurrenceCount", + EndByDate = "EndByDate", + } + enum BootstrapSchedulerRecurrenceType { + Daily = "Daily", + Weekly = "Weekly", + Monthly = "Monthly", + Yearly = "Yearly", + Hourly = "Hourly", + } + enum WeekDays { + Sunday = 1, + Monday = 2, + Tuesday = 4, + Wednesday = 8, + Thursday = 16, + Friday = 32, + Saturday = 64, + WeekendDays = 65, + WorkDays = 62, + EveryDay = 127, + } + enum WeekOfMonth { + None = 0, + First = 1, + Second = 2, + Third = 3, + Fourth = 4, + Last = 5, + } + enum BootstrapPopupControlCloseReason { + API = "API", + CloseButton = "CloseButton", + OuterMouseClick = "OuterMouseClick", + MouseOut = "MouseOut", + Escape = "Escape", + } + + const Utils: { + getControls: () => Control[]; + getSerializedEditorValuesInContainer: (containerOrId: string | HTMLElement, processInvisibleEditors?: boolean) => any; + getEditorValuesInContainer: (containerOrId: string | HTMLElement, processInvisibleEditors?: boolean) => any; + }; + + interface EventArgs { + readonly sender: Control; + } + + interface CancelEventArgs extends EventArgs { + cancel: boolean; + } + + interface BeginCallbackEventArgs extends EventArgs { + readonly command: string; + } + + interface ProcessingModeEventArgs extends EventArgs { + processOnServer: boolean; + } + + interface ProcessingModeCancelEventArgs extends ProcessingModeEventArgs { + cancel: boolean; + } + + interface GlobalBeginCallbackEventArgs extends BeginCallbackEventArgs { + readonly control: Control; + } + + interface EndCallbackEventArgs extends EventArgs { // tslint:disable-line:no-empty-interface + } + + interface GlobalEndCallbackEventArgs extends EndCallbackEventArgs { + readonly control: Control; + } + + interface CustomDataCallbackEventArgs extends EventArgs { + result: string; + } + + interface CallbackErrorEventArgs extends EventArgs { + handled: boolean; + message: string; + } + + interface GlobalCallbackErrorEventArgs extends CallbackErrorEventArgs { + readonly control: Control; + } + + interface EditValidationEventArgs extends EventArgs { + errorText: string; + isValid: boolean; + value: string; + } + + interface ValidationCompletedEventArgs extends EventArgs { + readonly container: any; + readonly firstInvalidControl: Control; + readonly firstVisibleInvalidControl: Control; + readonly invisibleControlsValidated: boolean; + isValid: boolean; + readonly validationGroup: string; + } + + interface EditClickEventArgs extends EventArgs { + readonly htmlElement: any; + readonly htmlEvent: any; + } + + interface EditKeyEventArgs extends EventArgs { + readonly htmlEvent: any; + } + + class Control { + protected readonly instance: any; + protected constructor(instance: any); + readonly name: string; + adjustControl(): void; + getHeight(): number; + getMainElement(): any; + getParentControl(): any; + getVisible(): boolean; + getWidth(): number; + inCallback(): boolean; + sendMessageToAssistiveTechnology(message: string): void; + setHeight(height: number): void; + setVisible(visible: boolean): void; + setWidth(width: number): void; + on(eventName: K, callback: (this: Control, args?: ControlEventMap[K]) => void): this; + once(eventName: K, callback: (this: Control, args?: ControlEventMap[K]) => void): this; + off(): this; // tslint:disable-line:no-unnecessary-generics + off(eventName: K): this; // tslint:disable-line:unified-signatures no-unnecessary-generics + off(eventName: K, callback: (this: Control, args?: ControlEventMap[K]) => void): this; // tslint:disable-line:unified-signatures + } + interface ControlEventMap { + "init": EventArgs; + } + + class BootstrapClientEdit extends Control { + focus(): void; + getCaption(): string; + getEnabled(): boolean; + getErrorText(): string; + getInputElement(): any; + getIsValid(): boolean; + getReadOnly(): boolean; + getValue(): any; + setCaption(caption: string): void; + setEnabled(value: boolean): void; + setErrorText(errorText: string): void; + setIsValid(isValid: boolean): void; + setReadOnly(readOnly: boolean): void; + setValue(value: any): void; + validate(): void; + on(eventName: K, callback: (this: BootstrapClientEdit, args?: BootstrapClientEditEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapClientEdit, args?: BootstrapClientEditEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapClientEdit, args?: BootstrapClientEditEventMap[K]) => void): this; + } + interface BootstrapClientEditEventMap extends ControlEventMap { + "gotFocus": EventArgs; + "lostFocus": EventArgs; + "validation": EditValidationEventArgs; + "valueChanged": ProcessingModeEventArgs; + } + + interface AccordionItemEventArgs extends ProcessingModeEventArgs { + readonly htmlElement: object; + readonly htmlEvent: object; + readonly item: BootstrapAccordionItem; + } + + interface AccordionGroupEventArgs extends EventArgs { + readonly group: BootstrapAccordionGroup; + } + + interface AccordionGroupCancelEventArgs extends ProcessingModeCancelEventArgs { + readonly group: BootstrapAccordionGroup; + } + + interface AccordionGroupClickEventArgs extends AccordionGroupCancelEventArgs { + readonly htmlElement: object; + readonly htmlEvent: object; + } + + class BootstrapAccordion extends Control { + collapseAll(): void; + expandAll(): void; + getActiveGroup(): BootstrapAccordionGroup | null; + getGroup(index: number): BootstrapAccordionGroup | null; + getGroupByName(name: string): BootstrapAccordionGroup | null; + getGroupCount(): number; + getItemByName(name: string): BootstrapAccordionItem | null; + getSelectedItem(): BootstrapAccordionItem | null; + setActiveGroup(group: BootstrapAccordionGroup): void; + setSelectedItem(item: BootstrapAccordionItem): void; + on(eventName: K, callback: (this: BootstrapAccordion, args?: BootstrapAccordionEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapAccordion, args?: BootstrapAccordionEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapAccordion, args?: BootstrapAccordionEventMap[K]) => void): this; + } + interface BootstrapAccordionEventMap extends ControlEventMap { + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "endCallback": EndCallbackEventArgs; + "expandedChanged": AccordionGroupEventArgs; + "expandedChanging": AccordionGroupCancelEventArgs; + "headerClick": AccordionGroupClickEventArgs; + "itemClick": AccordionItemEventArgs; + } + + class BootstrapAccordionGroup { + protected readonly instance: any; + protected constructor(instance: any); + readonly index: number; + readonly name: string; + readonly navBar: BootstrapAccordion | null; + getEnabled(): boolean; + getExpanded(): boolean; + getHeaderBadgeIconCssClass(): string; + getHeaderBadgeText(): string; + getItem(index: number): BootstrapAccordionItem | null; + getItemByName(name: string): BootstrapAccordionItem | null; + getItemCount(): number; + getText(): string; + getVisible(): boolean; + setExpanded(value: boolean): void; + setHeaderBadgeIconCssClass(cssClass: string): void; + setHeaderBadgeText(text: string): void; + setText(text: string): void; + setVisible(value: boolean): void; + } + + class BootstrapAccordionItem { + protected readonly instance: any; + protected constructor(instance: any); + readonly group: BootstrapAccordionGroup | null; + readonly index: number; + readonly name: string; + readonly navBar: BootstrapAccordion | null; + getBadgeIconCssClass(): string; + getBadgeText(): string; + getEnabled(): boolean; + getIconCssClass(): string; + getImageUrl(): string; + getNavigateUrl(): string; + getText(): string; + getVisible(): boolean; + setBadgeIconCssClass(cssClass: string): void; + setBadgeText(text: string): void; + setEnabled(value: boolean): void; + setIconCssClass(cssClass: string): void; + setImageUrl(value: string): void; + setNavigateUrl(value: string): void; + setText(value: string): void; + setVisible(value: boolean): void; + } + + class BootstrapBinaryImage extends BootstrapClientEdit { + clear(): void; + getUploadedFileName(): string; + getValue(): any; + performCallback(data: any): Promise; + performCallback(data: any, onSuccess: () => void): void; + setSize(width: number, height: number): void; + setValue(value: any): void; + on(eventName: K, callback: (this: BootstrapBinaryImage, args?: BootstrapBinaryImageEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapBinaryImage, args?: BootstrapBinaryImageEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapBinaryImage, args?: BootstrapBinaryImageEventMap[K]) => void): this; + } + interface BootstrapBinaryImageEventMap extends BootstrapClientEditEventMap { + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "click": EditClickEventArgs; + "endCallback": EndCallbackEventArgs; + } + + interface ButtonClickEventArgs extends ProcessingModeEventArgs { + readonly cancelEventAndBubble: boolean; + } + + class BootstrapButton extends Control { + doClick(): void; + focus(): void; + getBadgeIconCssClass(): string; + getBadgeText(): string; + getChecked(): boolean; + getEnabled(): boolean; + getImageUrl(): string; + getText(): string; + setBadgeIconCssClass(cssClass: string): void; + setBadgeText(text: string): void; + setChecked(value: boolean): void; + setEnabled(value: boolean): void; + setImageUrl(value: string): void; + setText(value: string): void; + on(eventName: K, callback: (this: BootstrapButton, args?: BootstrapButtonEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapButton, args?: BootstrapButtonEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapButton, args?: BootstrapButtonEventMap[K]) => void): this; + } + interface BootstrapButtonEventMap extends ControlEventMap { + "checkedChanged": ProcessingModeEventArgs; + "click": ButtonClickEventArgs; + "gotFocus": EventArgs; + "lostFocus": EventArgs; + } + + interface CalendarCustomDisabledDateEventArgs extends EventArgs { + readonly date: Date; + isDisabled: boolean; + } + + class BootstrapCalendar extends BootstrapClientEdit { + clearSelection(): void; + deselectDate(date: Date): void; + deselectRange(start: Date, end: Date): void; + getEnabled(): boolean; + getMaxDate(): Date; + getMinDate(): Date; + getSelectedDate(): Date; + getSelectedDates(): Date[]; + getVisibleDate(): Date; + isDateSelected(date: Date): boolean; + selectDate(date: Date): void; + selectRange(start: Date, end: Date): void; + setEnabled(enabled: boolean): void; + setMaxDate(date: Date): void; + setMinDate(date: Date): void; + setSelectedDate(date: Date): void; + setVisibleDate(date: Date): void; + on(eventName: K, callback: (this: BootstrapCalendar, args?: BootstrapCalendarEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapCalendar, args?: BootstrapCalendarEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapCalendar, args?: BootstrapCalendarEventMap[K]) => void): this; + } + interface BootstrapCalendarEventMap extends BootstrapClientEditEventMap { + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "customDisabledDate": CalendarCustomDisabledDateEventArgs; + "endCallback": EndCallbackEventArgs; + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "selectionChanged": ProcessingModeEventArgs; + "visibleMonthChanged": ProcessingModeEventArgs; + } + + interface GridToolbarItemClickEventArgs extends ProcessingModeEventArgs { + readonly item: BootstrapMenuItem; + readonly toolbarIndex: number; + readonly toolbarName: string; + usePostBack: boolean; + } + + class BootstrapGridBase extends Control { + getToolbar(index: number): BootstrapMenu | null; + getToolbarByName(name: string): BootstrapMenu | null; + on(eventName: K, callback: (this: BootstrapGridBase, args?: BootstrapGridBaseEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapGridBase, args?: BootstrapGridBaseEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapGridBase, args?: BootstrapGridBaseEventMap[K]) => void): this; + } + interface BootstrapGridBaseEventMap extends ControlEventMap { + "toolbarItemClick": GridToolbarItemClickEventArgs; + } + + interface CardViewColumnCancelEventArgs extends CancelEventArgs { + readonly column: BootstrapCardViewColumn; + } + + interface CardViewCardFocusingEventArgs extends CancelEventArgs { + readonly htmlEvent: any; + readonly visibleIndex: number; + } + + interface CardViewCardClickEventArgs extends CancelEventArgs { + readonly htmlEvent: any; + readonly visibleIndex: number; + } + + interface CardViewCustomButtonEventArgs extends ProcessingModeEventArgs { + readonly buttonID: string; + readonly visibleIndex: number; + } + + interface CardViewSelectionEventArgs extends ProcessingModeEventArgs { + readonly isAllRecordsOnPage: boolean; + readonly isChangedOnServer: boolean; + readonly isSelected: boolean; + readonly visibleIndex: number; + } + + interface CardViewFocusEventArgs extends ProcessingModeEventArgs { + readonly isChangedOnServer: boolean; + } + + interface CardViewBatchEditStartEditingEventArgs extends CancelEventArgs { + readonly cardValues: any; + focusedColumn: BootstrapCardViewColumn; + readonly visibleIndex: number; + } + + interface CardViewBatchEditEndEditingEventArgs extends CancelEventArgs { + readonly cardValues: any; + readonly visibleIndex: number; + } + + interface CardViewBatchEditCardValidatingEventArgs extends EventArgs { + readonly validationInfo: any; + readonly visibleIndex: number; + } + + interface CardViewBatchEditConfirmShowingEventArgs extends CancelEventArgs { + readonly requestTriggerID: string; + } + + interface CardViewBatchEditTemplateCellFocusedEventArgs extends EventArgs { + readonly column: BootstrapCardViewColumn; + handled: boolean; + } + + interface CardViewBatchEditChangesSavingEventArgs extends CancelEventArgs { + readonly deletedValues: any; + readonly insertedValues: any; + readonly updatedValues: any; + } + + interface CardViewBatchEditChangesCancelingEventArgs extends CancelEventArgs { + readonly deletedValues: any; + readonly insertedValues: any; + readonly updatedValues: any; + } + + interface CardViewBatchEditCardInsertingEventArgs extends CancelEventArgs { + readonly visibleIndex: number; + } + + interface CardViewBatchEditCardDeletingEventArgs extends CancelEventArgs { + readonly cardValues: any; + readonly visibleIndex: number; + } + + interface CardViewFocusedCellChangingEventArgs extends CancelEventArgs { + readonly cellInfo: BootstrapCardViewCellInfo; + } + + class BootstrapCardView extends BootstrapGridBase { + readonly batchEditApi: BootstrapCardViewBatchEditApi | null; + addNewCard(): void; + applyFilter(filterExpression: string): void; + applySearchPanelFilter(value: string): void; + cancelEdit(): void; + clearFilter(): void; + closeFilterControl(): void; + deleteCard(visibleIndex: number): void; + deleteCardByKey(key: any): void; + focus(): void; + focusEditor(column: BootstrapCardViewColumn): void; + focusEditor(columnIndex: number): void; // tslint:disable-line:unified-signatures + focusEditor(columnFieldNameOrId: string): void; // tslint:disable-line:unified-signatures unified-signatures + getCardKey(visibleIndex: number): string; + getColumn(columnIndex: number): BootstrapCardViewColumn | null; + getColumnByField(columnFieldName: string): BootstrapCardViewColumn | null; + getColumnById(columnId: string): BootstrapCardViewColumn | null; + getColumnCount(): number; + getEditValue(column: BootstrapCardViewColumn): string; + getEditValue(columnIndex: number): string; // tslint:disable-line:unified-signatures + getEditValue(columnFieldNameOrId: string): string; // tslint:disable-line:unified-signatures unified-signatures + getEditor(column: BootstrapCardViewColumn): BootstrapClientEdit; + getEditor(columnIndex: number): BootstrapClientEdit; // tslint:disable-line:unified-signatures + getEditor(columnFieldNameOrId: string): BootstrapClientEdit; // tslint:disable-line:unified-signatures unified-signatures + getFocusedCardIndex(): number; + getFocusedCell(): BootstrapCardViewCellInfo | null; + getPageCount(): number; + getPageIndex(): number; + getPopupEditForm(): BootstrapPopupControl | null; + getSelectedCardCount(): number; + getSelectedKeysOnPage(): any[]; + getTopVisibleIndex(): number; + getVerticalScrollPosition(): number; + getVisibleCardsOnPage(): number; + gotoPage(pageIndex: number): void; + hideCustomizationWindow(): void; + isCardSelectedOnPage(visibleIndex: number): boolean; + isCustomizationWindowVisible(): boolean; + isEditing(): boolean; + isNewCardEditing(): boolean; + moveColumn(column: BootstrapCardViewColumn): void; + moveColumn(columnIndex: number): void; // tslint:disable-line:unified-signatures + moveColumn(columnFieldNameOrId: string): void; // tslint:disable-line:unified-signatures unified-signatures + moveColumn(column: BootstrapCardViewColumn, moveToColumnVisibleIndex: number): void; // tslint:disable-line:unified-signatures + moveColumn(columnIndex: number, moveToColumnVisibleIndex: number): void; // tslint:disable-line:unified-signatures unified-signatures + moveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + moveColumn(column: BootstrapCardViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean): void; // tslint:disable-line:unified-signatures + moveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean): void; // tslint:disable-line:unified-signatures unified-signatures + moveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + nextPage(): void; + performCallback(data: any): Promise; + performCallback(data: any, onSuccess: () => void): void; + prevPage(): void; + refresh(): void; + selectAllCardsOnPage(): void; + selectCardOnPage(visibleIndex: number): void; + selectCardOnPage(visibleIndex: number, selected: boolean): void; // tslint:disable-line:unified-signatures + selectCards(): void; + selectCardsByKey(keys: any[]): void; + selectCardsByKey(key: any): void; // tslint:disable-line:unified-signatures + selectCardsByKey(keys: any[], selected: boolean): void; // tslint:disable-line:unified-signatures + selectCardsByKey(key: any, selected: boolean): void; // tslint:disable-line:unified-signatures unified-signatures + setEditValue(column: BootstrapCardViewColumn, value: string): void; + setEditValue(columnIndex: number, value: string): void; // tslint:disable-line:unified-signatures + setEditValue(columnFieldNameOrId: string, value: string): void; // tslint:disable-line:unified-signatures unified-signatures + setFilterEnabled(isFilterEnabled: boolean): void; + setFocusedCardIndex(visibleIndex: number): void; + setFocusedCell(cardVisibleIndex: number, columnIndex: number): void; + setSearchPanelCustomEditor(editor: BootstrapClientEdit): void; + setVerticalScrollPosition(position: number): void; + showCustomizationWindow(): void; + showFilterControl(): void; + sortBy(column: BootstrapCardViewColumn): void; + sortBy(columnIndex: number): void; // tslint:disable-line:unified-signatures + sortBy(columnFieldNameOrId: string): void; // tslint:disable-line:unified-signatures unified-signatures + sortBy(column: BootstrapCardViewColumn, sortOrder: string): void; // tslint:disable-line:unified-signatures + sortBy(columnIndex: number, sortOrder: string): void; // tslint:disable-line:unified-signatures unified-signatures + sortBy(columnFieldNameOrId: string, sortOrder: string): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + sortBy(column: BootstrapCardViewColumn, sortOrder: string, reset: boolean): void; // tslint:disable-line:unified-signatures + sortBy(columnIndex: number, sortOrder: string, reset: boolean): void; // tslint:disable-line:unified-signatures unified-signatures + sortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + sortBy(column: BootstrapCardViewColumn, sortOrder: string, reset: boolean, sortIndex: number): void; // tslint:disable-line:unified-signatures + sortBy(columnIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; // tslint:disable-line:unified-signatures unified-signatures + sortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + startEditCard(visibleIndex: number): void; + startEditCardByKey(key: any): void; + unselectAllCardsOnPage(): void; + unselectCardOnPage(visibleIndex: number): void; + unselectCards(): void; + unselectCardsByKey(keys: any[]): void; + unselectCardsByKey(key: any): void; // tslint:disable-line:unified-signatures + unselectFilteredCards(): void; + updateEdit(): void; + on(eventName: K, callback: (this: BootstrapCardView, args?: BootstrapCardViewEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapCardView, args?: BootstrapCardViewEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapCardView, args?: BootstrapCardViewEventMap[K]) => void): this; + } + interface BootstrapCardViewEventMap extends BootstrapGridBaseEventMap { + "batchEditCardDeleting": CardViewBatchEditCardDeletingEventArgs; + "batchEditCardInserting": CardViewBatchEditCardInsertingEventArgs; + "batchEditCardValidating": CardViewBatchEditCardValidatingEventArgs; + "batchEditChangesCanceling": CardViewBatchEditChangesCancelingEventArgs; + "batchEditChangesSaving": CardViewBatchEditChangesSavingEventArgs; + "batchEditConfirmShowing": CardViewBatchEditConfirmShowingEventArgs; + "batchEditEndEditing": CardViewBatchEditEndEditingEventArgs; + "batchEditStartEditing": CardViewBatchEditStartEditingEventArgs; + "batchEditTemplateCellFocused": CardViewBatchEditTemplateCellFocusedEventArgs; + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "cardClick": CardViewCardClickEventArgs; + "cardDblClick": CardViewCardClickEventArgs; + "cardFocusing": CardViewCardFocusingEventArgs; + "columnSorting": CardViewColumnCancelEventArgs; + "customButtonClick": CardViewCustomButtonEventArgs; + "customizationWindowCloseUp": EventArgs; + "endCallback": EndCallbackEventArgs; + "focusedCardChanged": CardViewFocusEventArgs; + "focusedCellChanging": CardViewFocusedCellChangingEventArgs; + "selectionChanged": CardViewSelectionEventArgs; + } + + class BootstrapCardViewBatchEditApi { + protected readonly instance: any; + protected constructor(instance: any); + addNewCard(): void; + deleteCard(visibleIndex: number): void; + deleteCardByKey(key: any): void; + getCardVisibleIndices(includeDeleted: boolean): number[]; + getDeletedCardIndices(): number[]; + getInsertedCardIndices(): number[]; + isDeletedCard(visibleIndex: number): boolean; + isNewCard(visibleIndex: number): boolean; + recoverCard(visibleIndex: number): void; + recoverCardByKey(key: any): void; + validateCard(visibleIndex: number): boolean; + validateCards(validateOnlyModified: boolean): boolean; + } + + class BootstrapCardViewColumn { + protected readonly instance: any; + protected constructor(instance: any); + } + + class BootstrapCardViewCellInfo { + protected readonly instance: any; + protected constructor(instance: any); + readonly cardVisibleIndex: number; + endEdit(): void; + getCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): any; + getCellValue(visibleIndex: number, columnFieldNameOrId: string, initial: boolean): any; + getColumnDisplayText(columnFieldNameOrId: string, value: any): string; + getEditCellInfo(): BootstrapCardViewCellInfo | null; + hasChanges(): boolean; + moveFocusBackward(): boolean; + moveFocusForward(): boolean; + resetChanges(visibleIndex: number): void; + resetChanges(visibleIndex: number, columnIndex: number): void; // tslint:disable-line:unified-signatures + setCellValue(visibleIndex: number, columnFieldNameOrId: string, value: any): void; + setCellValue(visibleIndex: number, columnFieldNameOrId: string, value: any, displayText: string, cancelCellHighlighting: boolean): void; + startEdit(visibleIndex: number, columnIndex: number): void; + } + + interface BootstrapChartEventArgsBase extends EventArgs { + readonly component: any; + readonly element: any; + } + + interface BootstrapChartErrorEventArgs extends BootstrapChartEventArgsBase { + readonly target: any; + } + + interface BootstrapChartElementActionEventArgs extends BootstrapChartEventArgsBase { + readonly target: any; + } + + interface BootstrapChartElementClickEventArgs extends BootstrapChartElementActionEventArgs { + readonly jQueryEvent: any; + } + + interface BootstrapChartExportEventArgs extends BootstrapChartEventArgsBase { + cancel: boolean; + readonly data: any; + readonly fileName: string; + readonly format: string; + } + + interface BootstrapChartOptionChangedEventArgs extends BootstrapChartEventArgsBase { + readonly fullName: string; + readonly name: string; + readonly previousValue: any; + readonly value: any; + } + + interface BootstrapChartZoomEndEventArgs extends BootstrapChartEventArgsBase { + readonly rangeEnd: any; + readonly rangeStart: any; + } + + class BootstrapChart extends Control { + exportTo(format: string, fileName: string): void; + getDataSource(): any; + getInstance(): any; + print(): void; + setDataSource(dataSource: any): void; + setOptions(options: any): void; + on(eventName: K, callback: (this: BootstrapChart, args?: BootstrapChartEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapChart, args?: BootstrapChartEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapChart, args?: BootstrapChartEventMap[K]) => void): this; + } + interface BootstrapChartEventMap extends ControlEventMap { + "argumentAxisClick": BootstrapChartElementClickEventArgs; + "disposing": BootstrapChartEventArgsBase; + "done": BootstrapChartEventArgsBase; + "drawn": BootstrapChartEventArgsBase; + "exported": BootstrapChartEventArgsBase; + "exporting": BootstrapChartExportEventArgs; + "fileSaving": BootstrapChartExportEventArgs; + "incidentOccurred": BootstrapChartErrorEventArgs; + "init": BootstrapChartEventArgsBase; + "legendClick": BootstrapChartElementClickEventArgs; + "optionChanged": BootstrapChartOptionChangedEventArgs; + "pointClick": BootstrapChartElementClickEventArgs; + "pointHoverChanged": BootstrapChartElementActionEventArgs; + "pointSelectionChanged": BootstrapChartElementActionEventArgs; + "seriesClick": BootstrapChartElementClickEventArgs; + "seriesHoverChanged": BootstrapChartElementActionEventArgs; + "seriesSelectionChanged": BootstrapChartElementActionEventArgs; + "tooltipHidden": BootstrapChartElementActionEventArgs; + "tooltipShown": BootstrapChartElementActionEventArgs; + "zoomEnd": BootstrapChartZoomEndEventArgs; + "zoomStart": BootstrapChartEventArgsBase; + } + + class BootstrapPolarChart extends Control { + exportTo(format: string, fileName: string): void; + getDataSource(): any; + getInstance(): any; + print(): void; + setDataSource(dataSource: any): void; + setOptions(options: any): void; + on(eventName: K, callback: (this: BootstrapPolarChart, args?: BootstrapPolarChartEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapPolarChart, args?: BootstrapPolarChartEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapPolarChart, args?: BootstrapPolarChartEventMap[K]) => void): this; + } + interface BootstrapPolarChartEventMap extends ControlEventMap { + "argumentAxisClick": BootstrapChartElementClickEventArgs; + "disposing": BootstrapChartEventArgsBase; + "done": BootstrapChartEventArgsBase; + "drawn": BootstrapChartEventArgsBase; + "exported": BootstrapChartEventArgsBase; + "exporting": BootstrapChartExportEventArgs; + "fileSaving": BootstrapChartExportEventArgs; + "incidentOccurred": BootstrapChartErrorEventArgs; + "init": BootstrapChartEventArgsBase; + "legendClick": BootstrapChartElementClickEventArgs; + "optionChanged": BootstrapChartOptionChangedEventArgs; + "pointClick": BootstrapChartElementClickEventArgs; + "pointHoverChanged": BootstrapChartElementActionEventArgs; + "pointSelectionChanged": BootstrapChartElementActionEventArgs; + "seriesClick": BootstrapChartElementClickEventArgs; + "seriesHoverChanged": BootstrapChartElementActionEventArgs; + "seriesSelectionChanged": BootstrapChartElementActionEventArgs; + "tooltipHidden": BootstrapChartElementActionEventArgs; + "tooltipShown": BootstrapChartElementActionEventArgs; + } + + class BootstrapPieChart extends Control { + exportTo(format: string, fileName: string): void; + getDataSource(): any; + getInstance(): any; + print(): void; + setDataSource(dataSource: any): void; + setOptions(options: any): void; + on(eventName: K, callback: (this: BootstrapPieChart, args?: BootstrapPieChartEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapPieChart, args?: BootstrapPieChartEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapPieChart, args?: BootstrapPieChartEventMap[K]) => void): this; + } + interface BootstrapPieChartEventMap extends ControlEventMap { + "disposing": BootstrapChartEventArgsBase; + "done": BootstrapChartEventArgsBase; + "drawn": BootstrapChartEventArgsBase; + "exported": BootstrapChartEventArgsBase; + "exporting": BootstrapChartExportEventArgs; + "fileSaving": BootstrapChartExportEventArgs; + "incidentOccurred": BootstrapChartErrorEventArgs; + "init": BootstrapChartEventArgsBase; + "legendClick": BootstrapChartElementClickEventArgs; + "optionChanged": BootstrapChartOptionChangedEventArgs; + "pointClick": BootstrapChartElementClickEventArgs; + "pointHoverChanged": BootstrapChartElementActionEventArgs; + "pointSelectionChanged": BootstrapChartElementActionEventArgs; + "tooltipHidden": BootstrapChartElementActionEventArgs; + "tooltipShown": BootstrapChartElementActionEventArgs; + } + + class BootstrapCheckBox extends BootstrapClientEdit { + getCheckState(): string; + getChecked(): boolean; + getText(): string; + setCheckState(checkState: string): void; + setChecked(isChecked: boolean): void; + setText(text: string): void; + on(eventName: K, callback: (this: BootstrapCheckBox, args?: BootstrapCheckBoxEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapCheckBox, args?: BootstrapCheckBoxEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapCheckBox, args?: BootstrapCheckBoxEventMap[K]) => void): this; + } + interface BootstrapCheckBoxEventMap extends BootstrapClientEditEventMap { + "checkedChanged": ProcessingModeEventArgs; + } + + class BootstrapRadioButton extends BootstrapClientEdit { + getCheckState(): string; + getChecked(): boolean; + getText(): string; + setCheckState(checkState: string): void; + setChecked(isChecked: boolean): void; + setText(text: string): void; + on(eventName: K, callback: (this: BootstrapRadioButton, args?: BootstrapRadioButtonEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapRadioButton, args?: BootstrapRadioButtonEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapRadioButton, args?: BootstrapRadioButtonEventMap[K]) => void): this; + } + interface BootstrapRadioButtonEventMap extends BootstrapClientEditEventMap { + "checkedChanged": ProcessingModeEventArgs; + } + + class BootstrapComboBox extends BootstrapClientEdit { + addItem(texts: string[]): number; + addItem(text: string): number; // tslint:disable-line:unified-signatures + addItem(texts: string[], value: any): number; // tslint:disable-line:unified-signatures + addItem(text: string, value: any): number; // tslint:disable-line:unified-signatures unified-signatures + addItem(texts: string[], value: any, iconCssClass: string): number; // tslint:disable-line:unified-signatures + addItem(text: string, value: any, iconCssClass: string): number; // tslint:disable-line:unified-signatures unified-signatures + addItemCssClass(index: number, className: string): void; + addItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + adjustDropDownWindow(): void; + beginUpdate(): void; + clearItems(): void; + endUpdate(): void; + ensureDropDownLoaded(callbackFunction: any): void; + findItemByText(text: string): BootstrapListBoxItem | null; + findItemByValue(value: any): BootstrapListBoxItem | null; + getButtonVisible(number: number): boolean; + getCaretPosition(): number; + getItem(index: number): BootstrapListBoxItem | null; + getItemBadgeIconCssClass(index: number): string; + getItemBadgeText(index: number): string; + getItemCount(): number; + getSelectedIndex(): number; + getSelectedItem(): BootstrapListBoxItem | null; + getText(): string; + hideDropDown(): void; + insertItem(index: number, texts: string[]): void; + insertItem(index: number, text: string): void; // tslint:disable-line:unified-signatures + insertItem(index: number, texts: string[], value: any): void; // tslint:disable-line:unified-signatures + insertItem(index: number, text: string, value: any): void; // tslint:disable-line:unified-signatures unified-signatures + insertItem(index: number, texts: string[], value: any, iconCssClass: string): void; // tslint:disable-line:unified-signatures + insertItem(index: number, text: string, value: any, iconCssClass: string): void; // tslint:disable-line:unified-signatures unified-signatures + makeItemVisible(index: number): void; + performCallback(data: any): Promise; + performCallback(data: any, onSuccess: () => void): void; + removeItem(index: number): void; + removeItemCssClass(index: number, className: string): void; + removeItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + selectAll(): void; + setButtonVisible(number: number, value: boolean): void; + setCaretPosition(position: number): void; + setItemBadgeIconCssClass(index: number, cssClass: string): void; + setItemBadgeText(index: number, text: string): void; + setItemHtml(index: number, html: string): void; + setItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + setItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + setItemTooltip(index: number, tooltip: string): void; + setSelectedIndex(index: number): void; + setSelectedItem(item: BootstrapListBoxItem): void; + setSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; + setText(text: string, applyFilter: boolean): void; + showDropDown(): void; + on(eventName: K, callback: (this: BootstrapComboBox, args?: BootstrapComboBoxEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapComboBox, args?: BootstrapComboBoxEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapComboBox, args?: BootstrapComboBoxEventMap[K]) => void): this; + } + interface BootstrapComboBoxEventMap extends BootstrapClientEditEventMap { + "beginCallback": BeginCallbackEventArgs; + "buttonClick": ButtonEditClickEventArgs; + "callbackError": CallbackErrorEventArgs; + "closeUp": EventArgs; + "customHighlighting": ListEditCustomHighlightingEventArgs; + "dropDown": EventArgs; + "endCallback": EndCallbackEventArgs; + "itemFiltering": ListEditItemFilteringEventArgs; + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "queryCloseUp": CancelEventArgs; + "selectedIndexChanged": ProcessingModeEventArgs; + "textChanged": ProcessingModeEventArgs; + "userInput": EventArgs; + } + + interface ParseDateEventArgs extends EventArgs { + readonly date: Date; + readonly handled: boolean; + readonly value: string; + } + + class BootstrapDateEdit extends BootstrapClientEdit { + adjustDropDownWindow(): void; + getButtonVisible(number: number): boolean; + getCalendar(): BootstrapCalendar | null; + getCaretPosition(): number; + getDate(): Date; + getMaxDate(): Date; + getMinDate(): Date; + getRangeDayCount(): number; + getText(): string; + getTimeEdit(): BootstrapTimeEdit | null; + hideDropDown(): void; + selectAll(): void; + setButtonVisible(number: number, value: boolean): void; + setCaretPosition(position: number): void; + setDate(date: Date): void; + setMaxDate(date: Date): void; + setMinDate(date: Date): void; + setSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; + setText(text: string): void; + showDropDown(): void; + on(eventName: K, callback: (this: BootstrapDateEdit, args?: BootstrapDateEditEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapDateEdit, args?: BootstrapDateEditEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapDateEdit, args?: BootstrapDateEditEventMap[K]) => void): this; + } + interface BootstrapDateEditEventMap extends BootstrapClientEditEventMap { + "buttonClick": ButtonEditClickEventArgs; + "calendarCustomDisabledDate": CalendarCustomDisabledDateEventArgs; + "closeUp": EventArgs; + "dateChanged": ProcessingModeEventArgs; + "dropDown": EventArgs; + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "parseDate": ParseDateEventArgs; + "queryCloseUp": CancelEventArgs; + "textChanged": ProcessingModeEventArgs; + "userInput": EventArgs; + } + + class BootstrapDropDownEdit extends BootstrapClientEdit { + adjustDropDownWindow(): void; + getButtonVisible(number: number): boolean; + getCaretPosition(): number; + getKeyValue(): string; + getText(): string; + hideDropDown(): void; + selectAll(): void; + setButtonVisible(number: number, value: boolean): void; + setCaretPosition(position: number): void; + setKeyValue(keyValue: string): void; + setSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; + setText(text: string): void; + showDropDown(): void; + on(eventName: K, callback: (this: BootstrapDropDownEdit, args?: BootstrapDropDownEditEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapDropDownEdit, args?: BootstrapDropDownEditEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapDropDownEdit, args?: BootstrapDropDownEditEventMap[K]) => void): this; + } + interface BootstrapDropDownEditEventMap extends BootstrapClientEditEventMap { + "buttonClick": ButtonEditClickEventArgs; + "closeUp": EventArgs; + "dropDown": EventArgs; + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "queryCloseUp": CancelEventArgs; + "textChanged": ProcessingModeEventArgs; + "userInput": EventArgs; + } + + class BootstrapFormLayout extends Control { + getItemByName(name: string): BootstrapFormLayoutItem | null; + on(eventName: K, callback: (this: BootstrapFormLayout, args?: BootstrapFormLayoutEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapFormLayout, args?: BootstrapFormLayoutEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapFormLayout, args?: BootstrapFormLayoutEventMap[K]) => void): this; + } + interface BootstrapFormLayoutEventMap extends ControlEventMap { // tslint:disable-line:no-empty-interface + } + + class BootstrapFormLayoutItem { + protected readonly instance: any; + protected constructor(instance: any); + readonly formLayout: BootstrapFormLayout | null; + readonly name: string; + readonly parent: BootstrapFormLayoutItem | null; + getCaption(): string; + getItemByName(name: string): BootstrapFormLayoutItem | null; + getVisible(): boolean; + setCaption(caption: string): void; + setVisible(value: boolean): void; + } + + interface GridViewColumnCancelEventArgs extends CancelEventArgs { + readonly column: BootstrapGridViewColumn; + } + + interface GridViewColumnProcessingModeEventArgs extends ProcessingModeEventArgs { + readonly column: BootstrapGridViewColumn; + } + + interface GridViewRowCancelEventArgs extends CancelEventArgs { + readonly visibleIndex: number; + } + + interface GridViewSelectionEventArgs extends ProcessingModeEventArgs { + readonly isAllRecordsOnPage: boolean; + readonly isChangedOnServer: boolean; + readonly isSelected: boolean; + readonly visibleIndex: number; + } + + interface GridViewFocusEventArgs extends ProcessingModeEventArgs { + readonly isChangedOnServer: boolean; + } + + interface GridViewRowFocusingEventArgs extends GridViewRowCancelEventArgs { + readonly htmlEvent: any; + } + + interface GridViewRowClickEventArgs extends GridViewRowCancelEventArgs { + readonly htmlEvent: any; + } + + interface GridViewContextMenuEventArgs extends EventArgs { + readonly htmlEvent: any; + readonly index: number; + readonly menu: any; + readonly objectType: string; + showBrowserMenu: boolean; + } + + interface GridViewContextMenuItemClickEventArgs extends ProcessingModeEventArgs { + readonly elementIndex: number; + handled: boolean; + readonly item: BootstrapMenuItem; + readonly objectType: string; + usePostBack: boolean; + } + + interface GridViewCustomButtonEventArgs extends ProcessingModeEventArgs { + readonly buttonID: string; + readonly visibleIndex: number; + } + + interface GridViewColumnMovingEventArgs extends EventArgs { + allow: boolean; + readonly destinationColumn: BootstrapGridViewColumn; + readonly isDropBefore: boolean; + readonly isGroupPanel: boolean; + readonly sourceColumn: BootstrapGridViewColumn; + } + + interface GridViewBatchEditConfirmShowingEventArgs extends CancelEventArgs { + readonly requestTriggerID: string; + } + + interface GridViewBatchEditStartEditingEventArgs extends CancelEventArgs { + focusedColumn: BootstrapGridViewColumn; + readonly rowValues: any; + readonly visibleIndex: number; + } + + interface GridViewBatchEditEndEditingEventArgs extends CancelEventArgs { + readonly rowValues: any; + readonly visibleIndex: number; + } + + interface GridViewBatchEditRowValidatingEventArgs extends EventArgs { + readonly validationInfo: any; + readonly visibleIndex: number; + } + + interface GridViewBatchEditTemplateCellFocusedEventArgs extends EventArgs { + readonly column: BootstrapGridViewColumn; + handled: boolean; + } + + interface GridViewBatchEditChangesSavingEventArgs extends CancelEventArgs { + readonly deletedValues: any; + readonly insertedValues: any; + readonly updatedValues: any; + } + + interface GridViewBatchEditChangesCancelingEventArgs extends CancelEventArgs { + readonly deletedValues: any; + readonly insertedValues: any; + readonly updatedValues: any; + } + + interface GridViewBatchEditRowInsertingEventArgs extends CancelEventArgs { + readonly visibleIndex: number; + } + + interface GridViewBatchEditRowDeletingEventArgs extends CancelEventArgs { + readonly rowValues: any; + readonly visibleIndex: number; + } + + interface GridViewFocusedCellChangingEventArgs extends CancelEventArgs { + readonly cellInfo: BootstrapGridViewCellInfo; + } + + class BootstrapGridView extends BootstrapGridBase { + readonly batchEditApi: BootstrapGridViewBatchEditApi | null; + addNewRow(): void; + applyFilter(filterExpression: string): void; + applyOnClickRowFilter(): void; + applySearchPanelFilter(value: string): void; + autoFilterByColumn(column: BootstrapGridViewColumn, val: string): void; + autoFilterByColumn(columnIndex: number, val: string): void; // tslint:disable-line:unified-signatures + autoFilterByColumn(columnFieldNameOrId: string, val: string): void; // tslint:disable-line:unified-signatures unified-signatures + cancelEdit(): void; + clearFilter(): void; + closeFilterControl(): void; + collapseAll(): void; + collapseAllDetailRows(): void; + collapseDetailRow(visibleIndex: number): void; + collapseRow(visibleIndex: number): void; + collapseRow(visibleIndex: number, recursive: boolean): void; // tslint:disable-line:unified-signatures + deleteRow(visibleIndex: number): void; + deleteRowByKey(key: any): void; + expandAll(): void; + expandAllDetailRows(): void; + expandDetailRow(visibleIndex: number): void; + expandRow(visibleIndex: number): void; + expandRow(visibleIndex: number, recursive: boolean): void; // tslint:disable-line:unified-signatures + focus(): void; + focusEditor(column: BootstrapGridViewColumn): void; + focusEditor(columnIndex: number): void; // tslint:disable-line:unified-signatures + focusEditor(columnFieldNameOrId: string): void; // tslint:disable-line:unified-signatures unified-signatures + getAutoFilterEditor(column: BootstrapGridViewColumn): any; + getAutoFilterEditor(columnIndex: number): any; // tslint:disable-line:unified-signatures + getAutoFilterEditor(columnFieldNameOrId: string): any; // tslint:disable-line:unified-signatures unified-signatures + getColumn(columnIndex: number): BootstrapGridViewColumn | null; + getColumnByField(columnFieldName: string): BootstrapGridViewColumn | null; + getColumnById(columnId: string): BootstrapGridViewColumn | null; + getColumnCount(): number; + getColumnLayout(): any; + getEditValue(column: BootstrapGridViewColumn): string; + getEditValue(columnIndex: number): string; // tslint:disable-line:unified-signatures + getEditValue(columnFieldNameOrId: string): string; // tslint:disable-line:unified-signatures unified-signatures + getEditor(column: BootstrapGridViewColumn): BootstrapClientEdit; + getEditor(columnIndex: number): BootstrapClientEdit; // tslint:disable-line:unified-signatures + getEditor(columnFieldNameOrId: string): BootstrapClientEdit; // tslint:disable-line:unified-signatures unified-signatures + getFocusedCell(): BootstrapGridViewCellInfo | null; + getFocusedRowIndex(): number; + getHorizontalScrollPosition(): number; + getPageCount(): number; + getPageIndex(): number; + getPopupEditForm(): BootstrapPopupControl | null; + getRowIndicesVisibleInViewPort(includePartiallyVisible: boolean): number[]; + getRowKey(visibleIndex: number): string; + getSelectedKeysOnPage(): any[]; + getSelectedRowCount(): number; + getTopVisibleIndex(): number; + getVerticalScrollPosition(): number; + getVisibleRowsOnPage(): number; + gotoPage(pageIndex: number): void; + groupBy(column: BootstrapGridViewColumn): void; + groupBy(columnIndex: number): void; // tslint:disable-line:unified-signatures + groupBy(columnFieldNameOrId: string): void; // tslint:disable-line:unified-signatures unified-signatures + groupBy(column: BootstrapGridViewColumn, groupIndex: number): void; // tslint:disable-line:unified-signatures + groupBy(columnIndex: number, groupIndex: number): void; // tslint:disable-line:unified-signatures unified-signatures + groupBy(columnFieldNameOrId: string, groupIndex: number): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + groupBy(column: BootstrapGridViewColumn, groupIndex: number, sortOrder: string): void; // tslint:disable-line:unified-signatures + groupBy(columnIndex: number, groupIndex: number, sortOrder: string): void; // tslint:disable-line:unified-signatures unified-signatures + groupBy(columnFieldNameOrId: string, groupIndex: number, sortOrder: string): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + hideCustomizationWindow(): void; + isCustomizationWindowVisible(): boolean; + isDataRow(visibleIndex: number): boolean; + isEditing(): boolean; + isGroupRow(visibleIndex: number): boolean; + isGroupRowExpanded(visibleIndex: number): boolean; + isNewRowEditing(): boolean; + isRowSelectedOnPage(visibleIndex: number): boolean; + makeRowVisible(visibleIndex: number): void; + nextPage(): void; + performCallback(data: any): Promise; + performCallback(data: any, onSuccess: () => void): void; + prevPage(): void; + refresh(): void; + selectAllRowsOnPage(): void; + selectRowOnPage(visibleIndex: number): void; + selectRowOnPage(visibleIndex: number, selected: boolean): void; // tslint:disable-line:unified-signatures + selectRows(): void; + selectRowsByKey(keys: any[]): void; + selectRowsByKey(key: any): void; // tslint:disable-line:unified-signatures + selectRowsByKey(keys: any[], selected: boolean): void; // tslint:disable-line:unified-signatures + selectRowsByKey(key: any, selected: boolean): void; // tslint:disable-line:unified-signatures unified-signatures + setColumnLayout(columnLayout: any): void; + setEditValue(column: BootstrapGridViewColumn, value: string): void; + setEditValue(columnIndex: number, value: string): void; // tslint:disable-line:unified-signatures + setEditValue(columnFieldNameOrId: string, value: string): void; // tslint:disable-line:unified-signatures unified-signatures + setFilterEnabled(isFilterEnabled: boolean): void; + setFixedColumnScrollableRows(scrollableRowSettings: any): void; + setFocusedCell(rowVisibleIndex: number, columnIndex: number): void; + setFocusedRowIndex(visibleIndex: number): void; + setHorizontalScrollPosition(position: number): void; + setSearchPanelCustomEditor(editor: BootstrapClientEdit): void; + setVerticalScrollPosition(position: number): void; + showCustomizationDialog(): void; + showCustomizationWindow(): void; + showFilterControl(): void; + sortBy(column: BootstrapGridViewColumn): void; + sortBy(columnIndex: number): void; // tslint:disable-line:unified-signatures + sortBy(columnFieldNameOrId: string): void; // tslint:disable-line:unified-signatures unified-signatures + sortBy(column: BootstrapGridViewColumn, sortOrder: string): void; // tslint:disable-line:unified-signatures + sortBy(columnIndex: number, sortOrder: string): void; // tslint:disable-line:unified-signatures unified-signatures + sortBy(columnFieldNameOrId: string, sortOrder: string): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + sortBy(column: BootstrapGridViewColumn, sortOrder: string, reset: boolean): void; // tslint:disable-line:unified-signatures + sortBy(columnIndex: number, sortOrder: string, reset: boolean): void; // tslint:disable-line:unified-signatures unified-signatures + sortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + sortBy(column: BootstrapGridViewColumn, sortOrder: string, reset: boolean, sortIndex: number): void; // tslint:disable-line:unified-signatures + sortBy(columnIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; // tslint:disable-line:unified-signatures unified-signatures + sortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; // tslint:disable-line:unified-signatures unified-signatures unified-signatures + startEditRow(visibleIndex: number): void; + startEditRowByKey(key: any): void; + ungroup(column: BootstrapGridViewColumn): void; + ungroup(columnIndex: number): void; // tslint:disable-line:unified-signatures + ungroup(columnFieldNameOrId: string): void; // tslint:disable-line:unified-signatures unified-signatures + unselectAllRowsOnPage(): void; + unselectFilteredRows(): void; + unselectRowOnPage(visibleIndex: number): void; + unselectRows(): void; + unselectRowsByKey(keys: any[]): void; + unselectRowsByKey(key: any): void; // tslint:disable-line:unified-signatures + updateEdit(): void; + on(eventName: K, callback: (this: BootstrapGridView, args?: BootstrapGridViewEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapGridView, args?: BootstrapGridViewEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapGridView, args?: BootstrapGridViewEventMap[K]) => void): this; + } + interface BootstrapGridViewEventMap extends BootstrapGridBaseEventMap { + "batchEditChangesCanceling": GridViewBatchEditChangesCancelingEventArgs; + "batchEditChangesSaving": GridViewBatchEditChangesSavingEventArgs; + "batchEditConfirmShowing": GridViewBatchEditConfirmShowingEventArgs; + "batchEditEndEditing": GridViewBatchEditEndEditingEventArgs; + "batchEditRowDeleting": GridViewBatchEditRowDeletingEventArgs; + "batchEditRowInserting": GridViewBatchEditRowInsertingEventArgs; + "batchEditRowValidating": GridViewBatchEditRowValidatingEventArgs; + "batchEditStartEditing": GridViewBatchEditStartEditingEventArgs; + "batchEditTemplateCellFocused": GridViewBatchEditTemplateCellFocusedEventArgs; + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "columnGrouping": GridViewColumnCancelEventArgs; + "columnMoving": GridViewColumnMovingEventArgs; + "columnResized": GridViewColumnProcessingModeEventArgs; + "columnResizing": GridViewColumnCancelEventArgs; + "columnSorting": GridViewColumnCancelEventArgs; + "columnStartDragging": GridViewColumnCancelEventArgs; + "contextMenu": GridViewContextMenuEventArgs; + "contextMenuItemClick": GridViewContextMenuItemClickEventArgs; + "customButtonClick": GridViewCustomButtonEventArgs; + "customizationWindowCloseUp": EventArgs; + "detailRowCollapsing": GridViewRowCancelEventArgs; + "detailRowExpanding": GridViewRowCancelEventArgs; + "endCallback": EndCallbackEventArgs; + "focusedCellChanging": GridViewFocusedCellChangingEventArgs; + "focusedRowChanged": GridViewFocusEventArgs; + "rowClick": GridViewRowClickEventArgs; + "rowCollapsing": GridViewRowCancelEventArgs; + "rowDblClick": GridViewRowClickEventArgs; + "rowExpanding": GridViewRowCancelEventArgs; + "rowFocusing": GridViewRowFocusingEventArgs; + "selectionChanged": GridViewSelectionEventArgs; + } + + class BootstrapGridViewBatchEditApi { + protected readonly instance: any; + protected constructor(instance: any); + addNewRow(): void; + deleteRow(visibleIndex: number): void; + deleteRowByKey(key: any): void; + endEdit(): void; + getCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): any; + getCellValue(visibleIndex: number, columnFieldNameOrId: string, initial: boolean): any; + getColumnDisplayText(columnFieldNameOrId: string, value: any): string; + getDeletedRowIndices(): number[]; + getEditCellInfo(): BootstrapGridViewCellInfo | null; + getInsertedRowIndices(): number[]; + getRowVisibleIndices(includeDeleted: boolean): number[]; + hasChanges(): boolean; + isDeletedRow(visibleIndex: number): boolean; + isNewRow(visibleIndex: number): boolean; + moveFocusBackward(): boolean; + moveFocusForward(): boolean; + recoverRow(visibleIndex: number): void; + recoverRowByKey(key: any): void; + resetChanges(visibleIndex: number): void; + resetChanges(visibleIndex: number, columnIndex: number): void; // tslint:disable-line:unified-signatures + setCellValue(visibleIndex: number, columnFieldNameOrId: string, value: any): void; + setCellValue(visibleIndex: number, columnFieldNameOrId: string, value: any, displayText: string, cancelCellHighlighting: boolean): void; + startEdit(visibleIndex: number, columnIndex: number): void; + validateRow(visibleIndex: number): boolean; + validateRows(validateOnlyModified: boolean): boolean; + } + + class BootstrapGridViewColumn { + protected readonly instance: any; + protected constructor(instance: any); + readonly fieldName: string; + readonly index: number; + readonly name: string; + readonly visible: boolean; + } + + class BootstrapGridViewCellInfo { + protected readonly instance: any; + protected constructor(instance: any); + readonly rowVisibleIndex: number; + } + + class BootstrapHyperLink extends Control { + getBadgeIconCssClass(): string; + getBadgeText(): string; + getCaption(): string; + getEnabled(): boolean; + getNavigateUrl(): string; + getText(): string; + getValue(): any; + setBadgeIconCssClass(cssClass: string): void; + setBadgeText(text: string): void; + setCaption(caption: string): void; + setEnabled(value: boolean): void; + setNavigateUrl(url: string): void; + setText(text: string): void; + setValue(value: any): void; + on(eventName: K, callback: (this: BootstrapHyperLink, args?: BootstrapHyperLinkEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapHyperLink, args?: BootstrapHyperLinkEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapHyperLink, args?: BootstrapHyperLinkEventMap[K]) => void): this; + } + interface BootstrapHyperLinkEventMap extends ControlEventMap { + "click": EditClickEventArgs; + } + + interface ListEditItemSelectedChangedEventArgs extends ProcessingModeEventArgs { + readonly index: number; + readonly isSelected: boolean; + } + + interface ListEditCustomHighlightingEventArgs extends EventArgs { + readonly filter: string; + highlighting: any; + } + + interface ListEditItemFilteringEventArgs extends EventArgs { + readonly filter: string; + isFit: boolean; + readonly item: BootstrapListBoxItem; + } + + class BootstrapListBox extends BootstrapClientEdit { + addItem(texts: string[]): number; + addItem(text: string): number; // tslint:disable-line:unified-signatures + addItem(texts: string[], value: any): number; // tslint:disable-line:unified-signatures + addItem(text: string, value: any): number; // tslint:disable-line:unified-signatures unified-signatures + addItem(texts: string[], value: any, iconCssClass: string): number; // tslint:disable-line:unified-signatures + addItem(text: string, value: any, iconCssClass: string): number; // tslint:disable-line:unified-signatures unified-signatures + addItemCssClass(index: number, className: string): void; + addItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + beginUpdate(): void; + clearItems(): void; + endUpdate(): void; + findItemByText(text: string): BootstrapListBoxItem | null; + findItemByValue(value: any): BootstrapListBoxItem | null; + getItem(index: number): BootstrapListBoxItem | null; + getItemBadgeIconCssClass(index: number): string; + getItemBadgeText(index: number): string; + getItemCount(): number; + getSelectedIndex(): number; + getSelectedIndices(): number[]; + getSelectedItem(): BootstrapListBoxItem | null; + getSelectedItems(): BootstrapListBoxItem[]; + getSelectedValues(): any[]; + insertItem(index: number, texts: string[]): void; + insertItem(index: number, text: string): void; // tslint:disable-line:unified-signatures + insertItem(index: number, texts: string[], value: any): void; // tslint:disable-line:unified-signatures + insertItem(index: number, text: string, value: any): void; // tslint:disable-line:unified-signatures unified-signatures + insertItem(index: number, texts: string[], value: any, iconCssClass: string): void; // tslint:disable-line:unified-signatures + insertItem(index: number, text: string, value: any, iconCssClass: string): void; // tslint:disable-line:unified-signatures unified-signatures + makeItemVisible(index: number): void; + performCallback(data: any): Promise; + performCallback(data: any, onSuccess: () => void): void; + removeItem(index: number): void; + removeItemCssClass(index: number, className: string): void; + removeItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + selectAll(): void; + selectIndices(indices: number[]): void; + selectItems(items: BootstrapListBoxItem[]): void; + selectValues(values: any[]): void; + setItemBadgeIconCssClass(index: number, cssClass: string): void; + setItemBadgeText(index: number, text: string): void; + setItemHtml(index: number, html: string): void; + setItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + setItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + setItemTooltip(index: number, tooltip: string): void; + setSelectedIndex(index: number): void; + setSelectedItem(item: BootstrapListBoxItem): void; + unselectAll(): void; + unselectIndices(indices: number[]): void; + unselectItems(items: BootstrapListBoxItem[]): void; + unselectValues(values: any[]): void; + on(eventName: K, callback: (this: BootstrapListBox, args?: BootstrapListBoxEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapListBox, args?: BootstrapListBoxEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapListBox, args?: BootstrapListBoxEventMap[K]) => void): this; + } + interface BootstrapListBoxEventMap extends BootstrapClientEditEventMap { + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "customHighlighting": ListEditCustomHighlightingEventArgs; + "endCallback": EndCallbackEventArgs; + "itemDoubleClick": EventArgs; + "itemFiltering": ListEditItemFilteringEventArgs; + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "selectedIndexChanged": ProcessingModeEventArgs; + } + + class BootstrapListBoxItem { + protected readonly instance: any; + protected constructor(instance: any); + readonly iconCssClass: string; + readonly imageUrl: string; + readonly index: number; + readonly listEditBase: BootstrapListBox | null; + readonly text: string; + readonly value: any; + getColumnText(columnIndex: number): string; + getColumnText(columnName: string): string; // tslint:disable-line:unified-signatures + getFieldText(fieldIndex: number): string; + getFieldText(fieldName: string): string; // tslint:disable-line:unified-signatures + } + + class BootstrapCheckBoxList extends BootstrapListBox { + getItem(index: number): BootstrapListBoxItem | null; + getItemCount(): number; + getSelectedIndices(): number[]; + getSelectedItems(): BootstrapListBoxItem[]; + getSelectedValues(): any[]; + selectAll(): void; + selectIndices(indices: number[]): void; + selectItems(items: BootstrapListBoxItem[]): void; + selectValues(values: any[]): void; + unselectAll(): void; + unselectIndices(indices: number[]): void; + unselectItems(items: BootstrapListBoxItem[]): void; + unselectValues(values: any[]): void; + on(eventName: K, callback: (this: BootstrapCheckBoxList, args?: BootstrapCheckBoxListEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapCheckBoxList, args?: BootstrapCheckBoxListEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapCheckBoxList, args?: BootstrapCheckBoxListEventMap[K]) => void): this; + } + interface BootstrapCheckBoxListEventMap extends BootstrapListBoxEventMap { // tslint:disable-line:no-empty-interface + } + + class BootstrapRadioButtonList extends BootstrapListBox { + getItem(index: number): BootstrapListBoxItem | null; + getItemCount(): number; + on(eventName: K, callback: (this: BootstrapRadioButtonList, args?: BootstrapRadioButtonListEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapRadioButtonList, args?: BootstrapRadioButtonListEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapRadioButtonList, args?: BootstrapRadioButtonListEventMap[K]) => void): this; + } + interface BootstrapRadioButtonListEventMap extends BootstrapListBoxEventMap { // tslint:disable-line:no-empty-interface + } + + interface MenuItemEventArgs extends EventArgs { + readonly item: BootstrapMenuItem; + } + + interface MenuItemMouseEventArgs extends MenuItemEventArgs { // tslint:disable-line:no-empty-interface + } + + interface MenuItemClickEventArgs extends ProcessingModeEventArgs { + readonly htmlElement: object; + readonly htmlEvent: object; + readonly item: BootstrapMenuItem; + } + + class BootstrapMenu extends Control { + getItem(index: number): BootstrapMenuItem | null; + getItemByName(name: string): BootstrapMenuItem | null; + getItemCount(): number; + getOrientation(): string; + getRootItem(): BootstrapMenuItem | null; + getSelectedItem(): BootstrapMenuItem | null; + setOrientation(orientation: string): void; + setSelectedItem(item: BootstrapMenuItem): void; + on(eventName: K, callback: (this: BootstrapMenu, args?: BootstrapMenuEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapMenu, args?: BootstrapMenuEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapMenu, args?: BootstrapMenuEventMap[K]) => void): this; + } + interface BootstrapMenuEventMap extends ControlEventMap { + "closeUp": MenuItemEventArgs; + "itemClick": MenuItemClickEventArgs; + "itemMouseOut": MenuItemMouseEventArgs; + "itemMouseOver": MenuItemMouseEventArgs; + "popUp": MenuItemEventArgs; + } + + class BootstrapMenuItem { + protected readonly instance: any; + protected constructor(instance: any); + readonly index: number; + readonly indexPath: string; + readonly menu: BootstrapMenu | null; + readonly name: string; + readonly parent: BootstrapMenuItem | null; + getBadgeIconCssClass(): string; + getBadgeText(): string; + getChecked(): boolean; + getEnabled(): boolean; + getIconCssClass(): string; + getImageUrl(): string; + getItem(index: number): BootstrapMenuItem | null; + getItemByName(name: string): BootstrapMenuItem | null; + getItemCount(): number; + getNavigateUrl(): string; + getText(): string; + getVisible(): boolean; + setBadgeIconCssClass(cssClass: string): void; + setBadgeText(text: string): void; + setChecked(value: boolean): void; + setEnabled(value: boolean): void; + setIconCssClass(cssClass: string): void; + setImageUrl(value: string): void; + setNavigateUrl(value: string): void; + setText(value: string): void; + setVisible(value: boolean): void; + } + + interface PopupWindowEventArgs extends EventArgs { + readonly window: BootstrapPopupWindow; + } + + interface PopupWindowCloseUpEventArgs extends PopupWindowEventArgs { + readonly closeReason: BootstrapPopupControlCloseReason; + } + + interface PopupWindowCancelEventArgs extends CancelEventArgs { + readonly closeReason: BootstrapPopupControlCloseReason; + readonly window: BootstrapPopupWindow; + } + + interface PopupWindowPinnedChangedEventArgs extends PopupWindowEventArgs { + readonly pinned: boolean; + } + + interface PopupWindowResizeEventArgs extends PopupWindowEventArgs { + readonly resizeState: number; + } + + class BootstrapPopupControl extends Control { + adjustSize(): void; + bringToFront(): void; + bringWindowToFront(window: BootstrapPopupWindow): void; + getCollapsed(): boolean; + getContentHeight(): number; + getContentHtml(): string; + getContentIFrame(): any; + getContentIFrameWindow(): any; + getContentUrl(): string; + getContentWidth(): number; + getCurrentPopupElement(): any; + getCurrentPopupElementIndex(): number; + getFooterImageUrl(): string; + getFooterNavigateUrl(): string; + getFooterText(): string; + getHeaderImageUrl(): string; + getHeaderNavigateUrl(): string; + getHeaderText(): string; + getMainElement(): any; + getMaximized(): boolean; + getPinned(): boolean; + getPopUpReasonMouseEvent(): any; + getWindow(index: number): BootstrapPopupWindow | null; + getWindowByName(name: string): BootstrapPopupWindow | null; + getWindowCollapsed(window: BootstrapPopupWindow): boolean; + getWindowContentHeight(window: BootstrapPopupWindow): number; + getWindowContentHtml(window: BootstrapPopupWindow): string; + getWindowContentIFrame(window: BootstrapPopupWindow): any; + getWindowContentUrl(window: BootstrapPopupWindow): string; + getWindowContentWidth(window: BootstrapPopupWindow): number; + getWindowCount(): number; + getWindowCurrentPopupElement(window: BootstrapPopupWindow): any; + getWindowCurrentPopupElementIndex(window: BootstrapPopupWindow): number; + getWindowHeight(window: BootstrapPopupWindow): number; + getWindowMaximized(window: BootstrapPopupWindow): boolean; + getWindowPinned(window: BootstrapPopupWindow): boolean; + getWindowPopUpReasonMouseEvent(window: BootstrapPopupWindow): any; + getWindowWidth(window: BootstrapPopupWindow): number; + hide(): void; + hideWindow(window: BootstrapPopupWindow): void; + isVisible(): boolean; + isWindowVisible(window: BootstrapPopupWindow): boolean; + performCallback(data: any): Promise; + performCallback(data: any, onSuccess: () => void): void; + refreshContentUrl(): void; + refreshPopupElementConnection(): void; + refreshWindowContentUrl(window: BootstrapPopupWindow): void; + setAdaptiveMaxHeight(maxHeight: number): void; + setAdaptiveMaxHeight(maxHeight: string): void; // tslint:disable-line:unified-signatures + setAdaptiveMaxWidth(maxWidth: number): void; + setAdaptiveMaxWidth(maxWidth: string): void; // tslint:disable-line:unified-signatures + setAdaptiveMinHeight(minHeight: number): void; + setAdaptiveMinHeight(minHeight: string): void; // tslint:disable-line:unified-signatures + setAdaptiveMinWidth(minWidth: number): void; + setAdaptiveMinWidth(minWidth: string): void; // tslint:disable-line:unified-signatures + setCollapsed(value: boolean): void; + setContentHtml(html: string): void; + setContentUrl(url: string): void; + setFooterImageUrl(value: string): void; + setFooterNavigateUrl(value: string): void; + setFooterText(value: string): void; + setHeaderImageUrl(value: string): void; + setHeaderNavigateUrl(value: string): void; + setHeaderText(value: string): void; + setMaximized(value: boolean): void; + setPinned(value: boolean): void; + setPopupElementCssSelector(selector: string): void; + setPopupElementID(popupElementId: string): void; + setSize(width: number, height: number): void; + setWindowAdaptiveMaxHeight(window: BootstrapPopupWindow, maxHeight: number): void; + setWindowAdaptiveMaxHeight(window: BootstrapPopupWindow, maxHeight: string): void; // tslint:disable-line:unified-signatures + setWindowAdaptiveMaxWidth(window: BootstrapPopupWindow, maxWidth: number): void; + setWindowAdaptiveMaxWidth(window: BootstrapPopupWindow, maxWidth: string): void; // tslint:disable-line:unified-signatures + setWindowAdaptiveMinHeight(window: BootstrapPopupWindow, minHeight: number): void; + setWindowAdaptiveMinHeight(window: BootstrapPopupWindow, minHeight: string): void; // tslint:disable-line:unified-signatures + setWindowAdaptiveMinWidth(window: BootstrapPopupWindow, minWidth: number): void; + setWindowAdaptiveMinWidth(window: BootstrapPopupWindow, minWidth: string): void; // tslint:disable-line:unified-signatures + setWindowCollapsed(window: BootstrapPopupWindow, value: boolean): void; + setWindowContentHtml(window: BootstrapPopupWindow, html: string): void; + setWindowContentUrl(window: BootstrapPopupWindow, url: string): void; + setWindowMaximized(window: BootstrapPopupWindow, value: boolean): void; + setWindowPinned(window: BootstrapPopupWindow, value: boolean): void; + setWindowPopupElementID(window: BootstrapPopupWindow, popupElementId: string): void; + setWindowSize(window: BootstrapPopupWindow, width: number, height: number): void; + show(): void; + showAtElement(htmlElement: any): void; + showAtElementByID(id: string): void; + showAtPos(x: number, y: number): void; + showWindow(window: BootstrapPopupWindow): void; + showWindow(window: BootstrapPopupWindow, popupElementIndex: number): void; // tslint:disable-line:unified-signatures + showWindowAtElement(window: BootstrapPopupWindow, htmlElement: any): void; + showWindowAtElementByID(window: BootstrapPopupWindow, id: string): void; + showWindowAtPos(window: BootstrapPopupWindow, x: number, y: number): void; + stretchVertically(): void; + updatePosition(): void; + updatePositionAtElement(htmlElement: any): void; + updateWindowPosition(window: BootstrapPopupWindow): void; + updateWindowPositionAtElement(window: BootstrapPopupWindow, htmlElement: any): void; + windowStretchVertically(window: BootstrapPopupWindow): void; + on(eventName: K, callback: (this: BootstrapPopupControl, args?: BootstrapPopupControlEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapPopupControl, args?: BootstrapPopupControlEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapPopupControl, args?: BootstrapPopupControlEventMap[K]) => void): this; + } + interface BootstrapPopupControlEventMap extends ControlEventMap { + "afterResizing": PopupWindowEventArgs; + "beforeResizing": PopupWindowEventArgs; + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "closeUp": PopupWindowCloseUpEventArgs; + "closing": PopupWindowCancelEventArgs; + "endCallback": EndCallbackEventArgs; + "pinnedChanged": PopupWindowPinnedChangedEventArgs; + "popUp": PopupWindowEventArgs; + "resize": PopupWindowResizeEventArgs; + "shown": PopupWindowEventArgs; + } + + class BootstrapPopupWindow { + protected readonly instance: any; + protected constructor(instance: any); + readonly index: number; + readonly name: string; + readonly popupControl: BootstrapPopupControl | null; + getFooterImageUrl(): string; + getFooterNavigateUrl(): string; + getFooterText(): string; + getHeaderImageUrl(): string; + getHeaderNavigateUrl(): string; + getHeaderText(): string; + setFooterImageUrl(value: string): void; + setFooterNavigateUrl(value: string): void; + setFooterText(value: string): void; + setHeaderImageUrl(value: string): void; + setHeaderNavigateUrl(value: string): void; + setHeaderText(value: string): void; + } + + class BootstrapPopupMenu extends BootstrapMenu { + getCurrentPopupElement(): any; + getCurrentPopupElementIndex(): number; + getItem(index: number): BootstrapMenuItem | null; + getItemByName(name: string): BootstrapMenuItem | null; + getRootItem(): BootstrapMenuItem | null; + getSelectedItem(): BootstrapMenuItem | null; + hide(): void; + refreshPopupElementConnection(): void; + setPopupElementCssSelector(selector: string): void; + setPopupElementID(popupElementId: string): void; + setSelectedItem(item: BootstrapMenuItem): void; + show(): void; + showAtElement(htmlElement: any): void; + showAtElementByID(id: string): void; + showAtPos(x: number, y: number): void; + on(eventName: K, callback: (this: BootstrapPopupMenu, args?: BootstrapPopupMenuEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapPopupMenu, args?: BootstrapPopupMenuEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapPopupMenu, args?: BootstrapPopupMenuEventMap[K]) => void): this; + } + interface BootstrapPopupMenuEventMap extends BootstrapMenuEventMap { // tslint:disable-line:no-empty-interface + } + + class BootstrapProgressBar extends Control { + getCaption(): string; + getDisplayText(): string; + getEnabled(): boolean; + getMaximum(): number; + getMinimum(): number; + getPercent(): number; + getPosition(): number; + getValue(): any; + setCaption(caption: string): void; + setCustomDisplayFormat(text: string): void; + setEnabled(value: boolean): void; + setMaximum(max: number): void; + setMinMaxValues(minValue: number, maxValue: number): void; + setMinimum(min: number): void; + setPosition(position: number): void; + setValue(value: any): void; + on(eventName: K, callback: (this: BootstrapProgressBar, args?: BootstrapProgressBarEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapProgressBar, args?: BootstrapProgressBarEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapProgressBar, args?: BootstrapProgressBarEventMap[K]) => void): this; + } + interface BootstrapProgressBarEventMap extends ControlEventMap { // tslint:disable-line:no-empty-interface + } + + interface ActiveViewChangingEventArgs extends EventArgs { + cancel: boolean; + readonly newView: BootstrapSchedulerViewType; + readonly oldView: BootstrapSchedulerViewType; + } + + interface AppointmentClickEventArgs extends EventArgs { + readonly appointmentId: string; + readonly handled: boolean; + readonly htmlElement: object; + } + + interface AppointmentDeletingEventArgs extends CancelEventArgs { + readonly appointmentIds: object[]; + } + + interface AppointmentDragEventArgs extends EventArgs { + allow: boolean; + readonly dragInformation: BootstrapSchedulerAppointmentDragInfo[]; + readonly mouseEvent: any; + } + + interface AppointmentDropEventArgs extends EventArgs { + readonly dragInformation: BootstrapSchedulerAppointmentDragInfo[]; + handled: boolean; + readonly operation: BootstrapSchedulerAppointmentOperation; + } + + interface AppointmentResizeEventArgs extends EventArgs { + readonly appointmentId: string; + handled: boolean; + readonly newInterval: BootstrapTimeInterval; + readonly oldInterval: BootstrapTimeInterval; + readonly operation: BootstrapSchedulerAppointmentOperation; + } + + interface AppointmentResizingEventArgs extends EventArgs { + allow: boolean; + readonly appointmentId: string; + readonly mouseEvent: any; + readonly newInterval: BootstrapTimeInterval; + readonly oldInterval: BootstrapTimeInterval; + } + + interface AppointmentToolTipShowingEventArgs extends CancelEventArgs { + readonly appointment: BootstrapSchedulerAppointment; + } + + interface AppointmentsSelectionEventArgs extends EventArgs { + readonly appointmentIds: string[]; + } + + interface CellClickEventArgs extends EventArgs { + readonly htmlElement: object; + readonly interval: BootstrapTimeInterval; + readonly resource: string; + } + + interface MenuItemClickedEventArgs extends EventArgs { + handled: boolean; + readonly itemName: string; + } + + interface MoreButtonClickedEventArgs extends ProcessingModeEventArgs { + handled: boolean; + readonly interval: BootstrapTimeInterval; + readonly resource: string; + readonly targetDateTime: Date; + } + + interface ShortcutEventArgs extends EventArgs { + readonly commandName: string; + readonly handled: boolean; + readonly htmlEvent: object; + } + + class BootstrapScheduler extends Control { + appointmentFormCancel(): void; + appointmentFormDelete(): void; + appointmentFormSave(): void; + changeFormContainer(container: any): void; + changePopupMenuContainer(container: any): void; + changeTimeZoneId(timeZoneId: string): void; + changeToolTipContainer(container: any): void; + deleteAppointment(apt: BootstrapSchedulerAppointment): void; + deselectAppointmentById(aptId: any): void; + getActiveViewType(): BootstrapSchedulerViewType; + getAllDayAreaHeight(): number; + getAppointmentById(id: any): BootstrapSchedulerAppointment | null; + getAppointmentProperties(aptId: number, propertyNames: string[], onCallBack: any): string[]; + getGroupType(): BootstrapSchedulerGroupType; + getResourceNavigatorVisible(): boolean; + getScrollAreaHeight(): number; + getSelectedAppointmentIds(): string[]; + getSelectedInterval(): BootstrapTimeInterval | null; + getSelectedResource(): string; + getToolbarVisible(): boolean; + getTopRowTime(viewType: BootstrapSchedulerViewType): number; + getVisibleAppointments(): BootstrapSchedulerAppointment[]; + getVisibleIntervals(): BootstrapTimeInterval[]; + goToDateFormApply(): void; + goToDateFormCancel(): void; + gotoDate(date: Date): void; + gotoToday(): void; + hideLoadingPanel(): void; + inplaceEditFormCancel(): void; + inplaceEditFormSave(): void; + inplaceEditFormShowMore(): void; + insertAppointment(apt: BootstrapSchedulerAppointment): void; + navigateBackward(): void; + navigateForward(): void; + performCallback(parameter: string): void; + refresh(): void; + refreshClientAppointmentProperties(clientAppointment: BootstrapSchedulerAppointment, propertyNames: string[], onCallBack: any): void; + reminderFormCancel(): void; + reminderFormDismiss(): void; + reminderFormDismissAll(): void; + reminderFormSnooze(): void; + selectAppointmentById(aptId: any): void; + selectAppointmentById(aptId: any, scrollToSelection: boolean): void; // tslint:disable-line:unified-signatures + setActiveViewType(value: BootstrapSchedulerViewType): void; + setAllDayAreaHeight(height: number): void; + setGroupType(value: BootstrapSchedulerGroupType): void; + setHeight(height: number): void; + setResourceNavigatorVisible(visible: boolean): void; + setSelection(interval: BootstrapTimeInterval): void; + setSelection(interval: BootstrapTimeInterval, resourceId: string): void; // tslint:disable-line:unified-signatures + setSelection(interval: BootstrapTimeInterval, resourceId: string, scrollToSelection: boolean): void; // tslint:disable-line:unified-signatures + setToolbarVisible(visible: boolean): void; + setTopRowTime(duration: number): void; + setTopRowTime(duration: number, viewType: BootstrapSchedulerViewType): void; // tslint:disable-line:unified-signatures + setVisibleResources(resourceIds: string[]): void; + showAppointmentFormByClientId(aptClientId: string): void; + showAppointmentFormByServerId(aptServerId: string): void; + showInplaceEditor(start: Date, end: Date): void; + showInplaceEditor(start: Date, end: Date, resourceId: string): void; // tslint:disable-line:unified-signatures + showLoadingPanel(): void; + showSelectionToolTip(x: number, y: number): void; + updateAppointment(apt: BootstrapSchedulerAppointment): void; + on(eventName: K, callback: (this: BootstrapScheduler, args?: BootstrapSchedulerEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapScheduler, args?: BootstrapSchedulerEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapScheduler, args?: BootstrapSchedulerEventMap[K]) => void): this; + } + interface BootstrapSchedulerEventMap extends ControlEventMap { + "activeViewChanged": EventArgs; + "activeViewChanging": ActiveViewChangingEventArgs; + "appointmentClick": AppointmentClickEventArgs; + "appointmentDeleting": AppointmentDeletingEventArgs; + "appointmentDoubleClick": AppointmentClickEventArgs; + "appointmentDrag": AppointmentDragEventArgs; + "appointmentDrop": AppointmentDropEventArgs; + "appointmentResize": AppointmentResizeEventArgs; + "appointmentResizing": AppointmentResizingEventArgs; + "appointmentToolTipShowing": AppointmentToolTipShowingEventArgs; + "appointmentsSelectionChanged": AppointmentsSelectionEventArgs; + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "cellClick": CellClickEventArgs; + "cellDoubleClick": CellClickEventArgs; + "endCallback": EndCallbackEventArgs; + "menuItemClicked": MenuItemClickedEventArgs; + "moreButtonClicked": MoreButtonClickedEventArgs; + "selectionChanged": EventArgs; + "selectionChanging": EventArgs; + "shortcut": ShortcutEventArgs; + "visibleIntervalChanged": EventArgs; + } + + class BootstrapTimeInterval { + protected readonly instance: any; + protected constructor(instance: any); + contains(interval: BootstrapTimeInterval): boolean; + equals(interval: BootstrapTimeInterval): boolean; + getAllDay(): boolean; + getDuration(): number; + getEnd(): Date; + getStart(): Date; + intersectsWith(interval: BootstrapTimeInterval): boolean; + intersectsWithExcludingBounds(interval: BootstrapTimeInterval): boolean; + setAllDay(allDayValue: boolean): void; + setDuration(value: number): void; + setEnd(value: Date): void; + setStart(value: Date): void; + } + + class BootstrapSchedulerAppointment { + protected readonly instance: any; + protected constructor(instance: any); + readonly appointmentId: string; + readonly appointmentType: BootstrapSchedulerAppointmentType; + readonly interval: BootstrapTimeInterval | null; + readonly labelIndex: number; + readonly resources: string[]; + readonly statusIndex: number; + addResource(resourceId: object): void; + getAllDay(): boolean; + getAppointmentType(): BootstrapSchedulerAppointmentType; + getDescription(): string; + getDuration(): number; + getEnd(): Date; + getId(): any; + getLabelId(): number; + getLocation(): string; + getRecurrenceInfo(): BootstrapSchedulerRecurrenceInfo | null; + getRecurrencePattern(): BootstrapSchedulerAppointment | null; + getResource(index: number): any; + getStart(): Date; + getStatusId(): number; + getSubject(): string; + setAllDay(allDay: boolean): void; + setAppointmentType(type: BootstrapSchedulerAppointmentType): void; + setDescription(description: string): void; + setDuration(duration: number): void; + setEnd(end: Date): void; + setId(id: any): void; + setLabelId(statusId: number): void; + setLocation(location: string): void; + setRecurrenceInfo(recurrenceInfo: BootstrapSchedulerRecurrenceInfo): void; + setStart(start: Date): void; + setStatusId(statusId: number): void; + setSubject(subject: string): void; + } + + class BootstrapSchedulerAppointmentDragInfo { + protected readonly instance: any; + protected constructor(instance: any); + readonly appointmentId: string; + readonly newInterval: BootstrapTimeInterval | null; + readonly oldInterval: BootstrapTimeInterval | null; + } + + class BootstrapSchedulerAppointmentOperation { + protected readonly instance: any; + protected constructor(instance: any); + apply(): void; + cancel(): void; + } + + class BootstrapSchedulerRecurrenceInfo { + protected readonly instance: any; + protected constructor(instance: any); + getDayNumber(): number; + getDuration(): number; + getEnd(): Date; + getMonth(): number; + getOccurrenceCount(): number; + getPeriodicity(): number; + getRange(): BootstrapSchedulerRecurrenceRange; + getRecurrenceType(): BootstrapSchedulerRecurrenceType; + getStart(): Date; + getWeekDays(): WeekDays; + getWeekOfMonth(): WeekOfMonth; + setDayNumber(dayNumber: number): void; + setDuration(duration: number): void; + setEnd(end: Date): void; + setMonth(month: number): void; + setOccurrenceCount(occurrenceCount: number): void; + setPeriodicity(periodicity: number): void; + setRange(range: BootstrapSchedulerRecurrenceRange): void; + setRecurrenceType(type: BootstrapSchedulerRecurrenceType): void; + setStart(start: Date): void; + setWeekDays(weekDays: WeekDays): void; + setWeekOfMonth(weekOfMonth: WeekOfMonth): void; + } + + class BootstrapSparkline extends Control { + exportTo(fileName: string, format: string): void; + getDataSource(): any; + getInstance(): any; + print(): void; + setDataSource(dataSource: any): void; + setOptions(options: any): void; + on(eventName: K, callback: (this: BootstrapSparkline, args?: BootstrapSparklineEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapSparkline, args?: BootstrapSparklineEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapSparkline, args?: BootstrapSparklineEventMap[K]) => void): this; + } + interface BootstrapSparklineEventMap extends ControlEventMap { + "disposing": BootstrapChartEventArgsBase; + "drawn": BootstrapChartEventArgsBase; + "exported": BootstrapChartEventArgsBase; + "exporting": BootstrapChartExportEventArgs; + "fileSaving": BootstrapChartExportEventArgs; + "incidentOccurred": BootstrapChartErrorEventArgs; + "init": BootstrapChartEventArgsBase; + "optionChanged": BootstrapChartOptionChangedEventArgs; + "tooltipHidden": BootstrapChartEventArgsBase; + "tooltipShown": BootstrapChartEventArgsBase; + } + + class BootstrapTimeEdit extends BootstrapClientEdit { + getButtonVisible(number: number): boolean; + getCaretPosition(): number; + getDate(): Date; + getText(): string; + selectAll(): void; + setButtonVisible(number: number, value: boolean): void; + setCaretPosition(position: number): void; + setDate(date: Date): void; + setSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; + setText(text: string): void; + on(eventName: K, callback: (this: BootstrapTimeEdit, args?: BootstrapTimeEditEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapTimeEdit, args?: BootstrapTimeEditEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapTimeEdit, args?: BootstrapTimeEditEventMap[K]) => void): this; + } + interface BootstrapTimeEditEventMap extends BootstrapClientEditEventMap { + "buttonClick": ButtonEditClickEventArgs; + "dateChanged": ProcessingModeEventArgs; + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "textChanged": ProcessingModeEventArgs; + "userInput": EventArgs; + } + + class BootstrapSpinEdit extends BootstrapClientEdit { + getButtonVisible(number: number): boolean; + getCaretPosition(): number; + getMaxValue(): number; + getMinValue(): number; + getNumber(): number; + getText(): string; + selectAll(): void; + setButtonVisible(number: number, value: boolean): void; + setCaretPosition(position: number): void; + setMaxValue(value: number): void; + setMinValue(value: number): void; + setNumber(number: number): void; + setSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; + setText(text: string): void; + setValue(number: number): void; + on(eventName: K, callback: (this: BootstrapSpinEdit, args?: BootstrapSpinEditEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapSpinEdit, args?: BootstrapSpinEditEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapSpinEdit, args?: BootstrapSpinEditEventMap[K]) => void): this; + } + interface BootstrapSpinEditEventMap extends BootstrapClientEditEventMap { + "buttonClick": ButtonEditClickEventArgs; + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "numberChanged": ProcessingModeEventArgs; + "textChanged": ProcessingModeEventArgs; + "userInput": EventArgs; + } + + interface TabControlTabEventArgs extends EventArgs { + readonly tab: BootstrapTab; + } + + interface TabControlTabCancelEventArgs extends ProcessingModeCancelEventArgs { + reloadContentOnCallback: boolean; + readonly tab: BootstrapTab; + } + + interface TabControlTabClickEventArgs extends TabControlTabCancelEventArgs { + readonly htmlElement: object; + readonly htmlEvent: object; + } + + class BootstrapTabControl extends Control { + adjustSize(): void; + getActiveTab(): BootstrapTab | null; + getActiveTabIndex(): number; + getTab(index: number): BootstrapTab | null; + getTabByName(name: string): BootstrapTab | null; + getTabCount(): number; + setActiveTab(tab: BootstrapTab): void; + setActiveTabIndex(index: number): void; + on(eventName: K, callback: (this: BootstrapTabControl, args?: BootstrapTabControlEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapTabControl, args?: BootstrapTabControlEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapTabControl, args?: BootstrapTabControlEventMap[K]) => void): this; + } + interface BootstrapTabControlEventMap extends ControlEventMap { + "activeTabChanged": TabControlTabEventArgs; + "activeTabChanging": TabControlTabCancelEventArgs; + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "endCallback": EndCallbackEventArgs; + "tabClick": TabControlTabClickEventArgs; + } + + class BootstrapTab { + protected readonly instance: any; + protected constructor(instance: any); + readonly index: number; + readonly name: string; + readonly tabControl: BootstrapTabControl | null; + getActiveIconCssClass(): string; + getActiveImageUrl(): string; + getBadgeIconCssClass(): string; + getBadgeText(): string; + getEnabled(): boolean; + getIconCssClass(): string; + getImageUrl(): string; + getNavigateUrl(): string; + getText(): string; + getVisible(): boolean; + setActiveIconCssClass(cssClass: string): void; + setActiveImageUrl(value: string): void; + setBadgeIconCssClass(cssClass: string): void; + setBadgeText(text: string): void; + setEnabled(value: boolean): void; + setIconCssClass(cssClass: string): void; + setImageUrl(value: string): void; + setNavigateUrl(value: string): void; + setText(value: string): void; + setVisible(value: boolean): void; + } + + class BootstrapPageControl extends BootstrapTabControl { + getActiveTab(): BootstrapTab | null; + getTab(index: number): BootstrapTab | null; + getTabByName(name: string): BootstrapTab | null; + getTabContentHTML(tab: BootstrapTab): string; + performCallback(data: any): Promise; + performCallback(data: any, onSuccess: () => void): void; + setActiveTab(tab: BootstrapTab): void; + setTabContentHTML(tab: BootstrapTab, html: string): void; + on(eventName: K, callback: (this: BootstrapPageControl, args?: BootstrapPageControlEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapPageControl, args?: BootstrapPageControlEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapPageControl, args?: BootstrapPageControlEventMap[K]) => void): this; + } + interface BootstrapPageControlEventMap extends BootstrapTabControlEventMap { // tslint:disable-line:no-empty-interface + } + + class BootstrapTagBox extends BootstrapClientEdit { + addItem(texts: string[]): number; + addItem(text: string): number; // tslint:disable-line:unified-signatures + addItem(texts: string[], value: any): number; // tslint:disable-line:unified-signatures + addItem(text: string, value: any): number; // tslint:disable-line:unified-signatures unified-signatures + addItem(texts: string[], value: any, iconCssClass: string): number; // tslint:disable-line:unified-signatures + addItem(text: string, value: any, iconCssClass: string): number; // tslint:disable-line:unified-signatures unified-signatures + addItemCssClass(index: number, className: string): void; + addItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + addTag(text: string): void; + adjustDropDownWindow(): void; + beginUpdate(): void; + clearItems(): void; + clearTagCollection(): void; + endUpdate(): void; + ensureDropDownLoaded(callbackFunction: any): void; + findItemByText(text: string): BootstrapListBoxItem | null; + findItemByValue(value: any): BootstrapListBoxItem | null; + getButtonVisible(number: number): boolean; + getCaretPosition(): number; + getItem(index: number): BootstrapListBoxItem | null; + getItemBadgeIconCssClass(index: number): string; + getItemBadgeText(index: number): string; + getItemCount(): number; + getSelectedIndex(): number; + getSelectedItem(): BootstrapListBoxItem | null; + getTagCollection(): string[]; + getTagHtmlElement(index: number): any; + getTagIndexByText(text: string): number; + getTagRemoveButtonHtmlElement(index: number): any; + getTagTextHtmlElement(index: number): any; + getText(): string; + getValue(): string; + hideDropDown(): void; + insertItem(index: number, texts: string[]): void; + insertItem(index: number, text: string): void; // tslint:disable-line:unified-signatures + insertItem(index: number, texts: string[], value: any): void; // tslint:disable-line:unified-signatures + insertItem(index: number, text: string, value: any): void; // tslint:disable-line:unified-signatures unified-signatures + insertItem(index: number, texts: string[], value: any, iconCssClass: string): void; // tslint:disable-line:unified-signatures + insertItem(index: number, text: string, value: any, iconCssClass: string): void; // tslint:disable-line:unified-signatures unified-signatures + isCustomTag(text: string, caseSensitive: boolean): boolean; + makeItemVisible(index: number): void; + performCallback(data: any): Promise; + performCallback(data: any, onSuccess: () => void): void; + removeItem(index: number): void; + removeItemCssClass(index: number, className: string): void; + removeItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + removeTag(index: number): void; + removeTagByText(text: string): void; + selectAll(): void; + setButtonVisible(number: number, value: boolean): void; + setCaretPosition(position: number): void; + setItemBadgeIconCssClass(index: number, cssClass: string): void; + setItemBadgeText(index: number, text: string): void; + setItemHtml(index: number, html: string): void; + setItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + setItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + setItemTooltip(index: number, tooltip: string): void; + setSelectedIndex(index: number): void; + setSelectedItem(item: BootstrapListBoxItem): void; + setSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; + setTagCollection(collection: string[]): void; + setText(text: string): void; + setValue(value: string): void; + showDropDown(): void; + on(eventName: K, callback: (this: BootstrapTagBox, args?: BootstrapTagBoxEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapTagBox, args?: BootstrapTagBoxEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapTagBox, args?: BootstrapTagBoxEventMap[K]) => void): this; + } + interface BootstrapTagBoxEventMap extends BootstrapClientEditEventMap { + "beginCallback": BeginCallbackEventArgs; + "buttonClick": ButtonEditClickEventArgs; + "callbackError": CallbackErrorEventArgs; + "closeUp": EventArgs; + "customHighlighting": ListEditCustomHighlightingEventArgs; + "dropDown": EventArgs; + "endCallback": EndCallbackEventArgs; + "itemFiltering": ListEditItemFilteringEventArgs; + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "queryCloseUp": CancelEventArgs; + "selectedIndexChanged": ProcessingModeEventArgs; + "tagsChanged": EventArgs; + "textChanged": ProcessingModeEventArgs; + "userInput": EventArgs; + } + + interface ButtonEditClickEventArgs extends ProcessingModeEventArgs { + readonly buttonIndex: number; + } + + class BootstrapButtonEdit extends BootstrapClientEdit { + getButtonVisible(number: number): boolean; + getCaretPosition(): number; + getText(): string; + selectAll(): void; + setButtonVisible(number: number, value: boolean): void; + setCaretPosition(position: number): void; + setSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; + setText(text: string): void; + on(eventName: K, callback: (this: BootstrapButtonEdit, args?: BootstrapButtonEditEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapButtonEdit, args?: BootstrapButtonEditEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapButtonEdit, args?: BootstrapButtonEditEventMap[K]) => void): this; + } + interface BootstrapButtonEditEventMap extends BootstrapClientEditEventMap { + "buttonClick": ButtonEditClickEventArgs; + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "textChanged": ProcessingModeEventArgs; + "userInput": EventArgs; + } + + class BootstrapMemo extends BootstrapClientEdit { + getCaretPosition(): number; + getText(): string; + selectAll(): void; + setCaretPosition(position: number): void; + setSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; + setText(text: string): void; + on(eventName: K, callback: (this: BootstrapMemo, args?: BootstrapMemoEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapMemo, args?: BootstrapMemoEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapMemo, args?: BootstrapMemoEventMap[K]) => void): this; + } + interface BootstrapMemoEventMap extends BootstrapClientEditEventMap { + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "textChanged": ProcessingModeEventArgs; + "userInput": EventArgs; + } + + class BootstrapTextBox extends BootstrapClientEdit { + getCaretPosition(): number; + getText(): string; + selectAll(): void; + setCaretPosition(position: number): void; + setSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; + setText(text: string): void; + on(eventName: K, callback: (this: BootstrapTextBox, args?: BootstrapTextBoxEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapTextBox, args?: BootstrapTextBoxEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapTextBox, args?: BootstrapTextBoxEventMap[K]) => void): this; + } + interface BootstrapTextBoxEventMap extends BootstrapClientEditEventMap { + "keyDown": EditKeyEventArgs; + "keyPress": EditKeyEventArgs; + "keyUp": EditKeyEventArgs; + "textChanged": ProcessingModeEventArgs; + "userInput": EventArgs; + } + + class BootstrapToolbar extends BootstrapMenu { + on(eventName: K, callback: (this: BootstrapToolbar, args?: BootstrapToolbarEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapToolbar, args?: BootstrapToolbarEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapToolbar, args?: BootstrapToolbarEventMap[K]) => void): this; + } + interface BootstrapToolbarEventMap extends BootstrapMenuEventMap { // tslint:disable-line:no-empty-interface + } + + interface TreeViewNodeProcessingModeEventArgs extends ProcessingModeEventArgs { + readonly node: BootstrapTreeViewNode; + } + + interface TreeViewNodeClickEventArgs extends TreeViewNodeProcessingModeEventArgs { + readonly htmlElement: any; + readonly htmlEvent: any; + } + + interface TreeViewNodeEventArgs extends EventArgs { + readonly node: BootstrapTreeViewNode; + } + + interface TreeViewNodeCancelEventArgs extends ProcessingModeCancelEventArgs { + readonly node: BootstrapTreeViewNode; + } + + class BootstrapTreeView extends Control { + collapseAll(): void; + expandAll(): void; + getNode(index: number): BootstrapTreeViewNode | null; + getNodeByName(name: string): BootstrapTreeViewNode | null; + getNodeByText(text: string): BootstrapTreeViewNode | null; + getNodeCount(): number; + getRootNode(): BootstrapTreeViewNode | null; + getSelectedNode(): BootstrapTreeViewNode | null; + setSelectedNode(node: BootstrapTreeViewNode): void; + on(eventName: K, callback: (this: BootstrapTreeView, args?: BootstrapTreeViewEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapTreeView, args?: BootstrapTreeViewEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapTreeView, args?: BootstrapTreeViewEventMap[K]) => void): this; + } + interface BootstrapTreeViewEventMap extends ControlEventMap { + "beginCallback": BeginCallbackEventArgs; + "callbackError": CallbackErrorEventArgs; + "checkedChanged": TreeViewNodeProcessingModeEventArgs; + "endCallback": EndCallbackEventArgs; + "expandedChanged": TreeViewNodeEventArgs; + "expandedChanging": TreeViewNodeCancelEventArgs; + "nodeClick": TreeViewNodeClickEventArgs; + } + + class BootstrapTreeViewNode extends Control { + readonly index: number; + readonly name: string; + readonly parent: BootstrapTreeViewNode | null; + readonly treeView: BootstrapTreeView | null; + getBadgeIconCssClass(): string; + getBadgeText(): string; + getCheckState(): string; + getChecked(): boolean; + getEnabled(): boolean; + getExpanded(): boolean; + getHtmlElement(): any; + getIconCssClass(): string; + getImageUrl(): string; + getNavigateUrl(): string; + getNode(index: number): BootstrapTreeViewNode | null; + getNodeByName(name: string): BootstrapTreeViewNode | null; + getNodeByText(text: string): BootstrapTreeViewNode | null; + getNodeCount(): number; + getText(): string; + getVisible(): boolean; + setBadgeIconCssClass(cssClass: string): void; + setBadgeText(text: string): void; + setChecked(value: boolean): void; + setEnabled(value: boolean): void; + setExpanded(value: boolean): void; + setIconCssClass(cssClass: string): void; + setImageUrl(value: string): void; + setNavigateUrl(value: string): void; + setText(value: string): void; + setVisible(value: boolean): void; + on(eventName: K, callback: (this: BootstrapTreeViewNode, args?: BootstrapTreeViewNodeEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapTreeViewNode, args?: BootstrapTreeViewNodeEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapTreeViewNode, args?: BootstrapTreeViewNodeEventMap[K]) => void): this; + } + interface BootstrapTreeViewNodeEventMap extends ControlEventMap { // tslint:disable-line:no-empty-interface + } + + interface UploadControlFilesUploadStartEventArgs extends EventArgs { + readonly cancel: boolean; + } + + interface UploadControlFileUploadCompleteEventArgs extends EventArgs { + readonly callbackData: string; + readonly errorText: string; + readonly inputIndex: number; + readonly isValid: boolean; + } + + interface UploadControlFilesUploadCompleteEventArgs extends EventArgs { + readonly callbackData: string; + readonly errorText: string; + } + + interface UploadControlTextChangedEventArgs extends EventArgs { + readonly inputIndex: number; + } + + interface UploadControlUploadingProgressChangedEventArgs extends EventArgs { + readonly currentFileContentLength: number; + readonly currentFileName: string; + readonly currentFileProgress: number; + readonly currentFileUploadedContentLength: number; + readonly fileCount: number; + readonly progress: number; + readonly totalContentLength: number; + readonly uploadedContentLength: number; + } + + interface UploadControlValidationErrorOccurredEventArgs extends EventArgs { + errorText: string; + readonly invalidFiles: BootstrapUploadControlInvalidFileInfo[]; + showAlert: boolean; + readonly validationSettings: BootstrapUploadControlValidationSettings; + } + + interface UploadControlDropZoneEnterEventArgs extends EventArgs { + readonly dropZone: any; + } + + interface UploadControlDropZoneLeaveEventArgs extends EventArgs { + readonly dropZone: any; + } + + class BootstrapUploadControl extends Control { + addFileInput(): void; + cancel(): void; + clearText(): void; + getAddButtonText(): string; + getEnabled(): boolean; + getFileInputCount(): number; + getSelectedFiles(inputIndex: number): BootstrapUploadControlFile[]; + getText(index: number): string; + getUploadButtonText(): string; + removeFileFromSelection(fileIndex: number): void; + removeFileFromSelection(file: BootstrapUploadControlFile): void; // tslint:disable-line:unified-signatures + removeFileInput(index: number): void; + setAddButtonText(text: string): void; + setDialogTriggerID(ids: string): void; + setEnabled(enabled: boolean): void; + setFileInputCount(count: number): void; + setUploadButtonText(text: string): void; + upload(): void; + on(eventName: K, callback: (this: BootstrapUploadControl, args?: BootstrapUploadControlEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapUploadControl, args?: BootstrapUploadControlEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapUploadControl, args?: BootstrapUploadControlEventMap[K]) => void): this; + } + interface BootstrapUploadControlEventMap extends ControlEventMap { + "dropZoneEnter": UploadControlDropZoneEnterEventArgs; + "dropZoneLeave": UploadControlDropZoneLeaveEventArgs; + "fileInputCountChanged": EventArgs; + "fileUploadComplete": UploadControlFileUploadCompleteEventArgs; + "filesUploadComplete": UploadControlFilesUploadCompleteEventArgs; + "filesUploadStart": UploadControlFilesUploadStartEventArgs; + "textChanged": UploadControlTextChangedEventArgs; + "uploadingProgressChanged": UploadControlUploadingProgressChangedEventArgs; + "validationErrorOccurred": UploadControlValidationErrorOccurredEventArgs; + } + + class BootstrapUploadControlFile extends Control { + readonly name: string; + readonly size: number; + readonly sourceFileObject: any; + on(eventName: K, callback: (this: BootstrapUploadControlFile, args?: BootstrapUploadControlFileEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapUploadControlFile, args?: BootstrapUploadControlFileEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapUploadControlFile, args?: BootstrapUploadControlFileEventMap[K]) => void): this; + } + interface BootstrapUploadControlFileEventMap extends ControlEventMap { // tslint:disable-line:no-empty-interface + } + + class BootstrapUploadControlInvalidFileInfo extends Control { + readonly fileName: string; + readonly fileSize: number; + on(eventName: K, callback: (this: BootstrapUploadControlInvalidFileInfo, args?: + BootstrapUploadControlInvalidFileInfoEventMap[K]) => void): this; + once(eventName: K, callback: (this: BootstrapUploadControlInvalidFileInfo, + args?: BootstrapUploadControlInvalidFileInfoEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: BootstrapUploadControlInvalidFileInfo, + args?: BootstrapUploadControlInvalidFileInfoEventMap[K]) => void): this; + } + interface BootstrapUploadControlInvalidFileInfoEventMap extends ControlEventMap { // tslint:disable-line:no-empty-interface + } + + class BootstrapUploadControlValidationSettings extends Control { + readonly allowedFileExtensions: string[]; + readonly invalidFileNameCharacters: string[]; + readonly maxFileCount: number; + readonly maxFileSize: number; + on(eventName: K, callback: (this: BootstrapUploadControlValidationSettings, + args?: BootstrapUploadControlValidationSettingsEventMap[K]) => void): this; + once(eventName: K, callback: (this: + BootstrapUploadControlValidationSettings, args?: BootstrapUploadControlValidationSettingsEventMap[K]) => void): this; + off(eventName?: K, callback?: (this: + BootstrapUploadControlValidationSettings, args?: BootstrapUploadControlValidationSettingsEventMap[K]) => void): this; + } + interface BootstrapUploadControlValidationSettingsEventMap extends ControlEventMap { // tslint:disable-line:no-empty-interface + } +} diff --git a/types/devexpress-aspnetcore-bootstrap/tsconfig.json b/types/devexpress-aspnetcore-bootstrap/tsconfig.json new file mode 100644 index 0000000000..1131d37582 --- /dev/null +++ b/types/devexpress-aspnetcore-bootstrap/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "devexpress-aspnetcore-bootstrap-tests.ts" + ] +} \ No newline at end of file diff --git a/types/devexpress-aspnetcore-bootstrap/tslint.json b/types/devexpress-aspnetcore-bootstrap/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/devexpress-aspnetcore-bootstrap/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 91c45b94e7..56a0879ae5 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -2368,7 +2368,7 @@ declare module 'ember' { function Exception(message: string): void; class SafeString { constructor(str: string); - static toString(): string; + toString(): string; } function parse(string: string): any; function print(ast: any): void; diff --git a/types/ember/tslint.json b/types/ember/tslint.json index 7069614893..f77f8d2ed8 100755 --- a/types/ember/tslint.json +++ b/types/ember/tslint.json @@ -24,8 +24,6 @@ "only-arrow-functions": false, "no-submodule-imports": false, - "no-unnecessary-class": false, - // false positives "unified-signatures": false } diff --git a/types/eventsource/eventsource-tests.ts b/types/eventsource/eventsource-tests.ts index 62f867926f..c1b53030cd 100644 --- a/types/eventsource/eventsource-tests.ts +++ b/types/eventsource/eventsource-tests.ts @@ -1,17 +1,39 @@ import EventSource = require("eventsource"); const eventSource = new EventSource("http://foobar"); -eventSource.onmessage = (x: any) => {}; -eventSource.onerror = (x: any) => {}; -eventSource.onopen = (x: any) => {}; -eventSource.addEventListener = (type: string, x: any) => {}; +let readyState: number = eventSource.readyState; +let closedState: number = eventSource.CLOSED; +closedState = EventSource.CLOSED; +let connectingState: number = eventSource.CONNECTING; +connectingState = EventSource.CONNECTING; +let openState: number = eventSource.OPEN; +openState = EventSource.OPEN; +let url: string = eventSource.url; +let withCredentials: boolean = eventSource.withCredentials; +eventSource.onmessage = (event: Event) => {}; +eventSource.onerror = (event: Event) => {}; +eventSource.onopen = (event: Event) => {}; +eventSource.addEventListener = (type: string, listener: (e: Event) => void) => {}; +eventSource.dispatchEvent = (event: Event) => true; +eventSource.removeEventListener = (type: string, listener: (e: Event) => void) => {}; eventSource.close(); import EventSourcePolyfill = require("eventsource/lib/eventsource-polyfill"); const eventSourcePolyfill = new EventSourcePolyfill("http://foobar"); -eventSourcePolyfill.onmessage = (x: any) => {}; -eventSourcePolyfill.onerror = (x: any) => {}; -eventSourcePolyfill.onopen = (x: any) => {}; -eventSourcePolyfill.addEventListener = (type: string, x: any) => {}; +readyState = eventSourcePolyfill.readyState; +closedState = eventSource.CLOSED; +closedState = EventSource.CLOSED; +connectingState = eventSource.CONNECTING; +connectingState = EventSource.CONNECTING; +openState = eventSource.OPEN; +openState = EventSource.OPEN; +url = eventSourcePolyfill.url; +withCredentials = eventSource.withCredentials; +eventSourcePolyfill.onmessage = (event: Event) => {}; +eventSourcePolyfill.onerror = (event: Event) => {}; +eventSourcePolyfill.onopen = (event: Event) => {}; +eventSourcePolyfill.addEventListener = (type: string, listener: (e: Event) => void) => {}; +eventSourcePolyfill.dispatchEvent = (event: Event) => true; +eventSourcePolyfill.removeEventListener = (type: string, listener: (e: Event) => void) => {}; eventSourcePolyfill.close(); diff --git a/types/eventsource/index.d.ts b/types/eventsource/index.d.ts index 62859d037b..1308515917 100644 --- a/types/eventsource/index.d.ts +++ b/types/eventsource/index.d.ts @@ -1,22 +1,29 @@ // Type definitions for eventsource 1.0 // Project: http://github.com/EventSource/eventsource // Definitions by: Scott Lee Davis +// Ali Afroozeh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.8 declare class EventSource { + static readonly CLOSED: number; + static readonly CONNECTING: number; + static readonly OPEN: number; + constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict); - static CLOSED: EventSource.ReadyState; - static CONNECTING: EventSource.ReadyState; - static OPEN: EventSource.ReadyState; - - url: string; - readyState: EventSource.ReadyState; + readonly CLOSED: number; + readonly CONNECTING: number; + readonly OPEN: number; + readonly url: string; + readonly readyState: number; + readonly withCredentials: boolean; onopen: EventListener; onmessage: EventListener; onerror: EventListener; addEventListener(type: string, listener: EventListener): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener?: EventListener): void; close(): void; } diff --git a/types/eventsource/lib/eventsource-polyfill/index.d.ts b/types/eventsource/lib/eventsource-polyfill/index.d.ts index 3e4ad378e4..86b82105cc 100644 --- a/types/eventsource/lib/eventsource-polyfill/index.d.ts +++ b/types/eventsource/lib/eventsource-polyfill/index.d.ts @@ -1,16 +1,22 @@ declare class EventSource { + static readonly CLOSED: number; + static readonly CONNECTING: number; + static readonly OPEN: number; + constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict); - static CLOSED: EventSource.ReadyState; - static CONNECTING: EventSource.ReadyState; - static OPEN: EventSource.ReadyState; - - url: string; - readyState: EventSource.ReadyState; + readonly CLOSED: number; + readonly CONNECTING: number; + readonly OPEN: number; + readonly url: string; + readonly readyState: number; + readonly withCredentials: boolean; onopen: EventListener; onmessage: EventListener; onerror: EventListener; addEventListener(type: string, listener: EventListener): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener?: EventListener): void; close(): void; } diff --git a/types/intl-locales-supported/index.d.ts b/types/intl-locales-supported/index.d.ts new file mode 100644 index 0000000000..62d88c0e54 --- /dev/null +++ b/types/intl-locales-supported/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for intl-locales-supported 1.0 +// Project: https://github.com/yahoo/intl-locales-supported +// Definitions by: Edward Sammut Alessi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = areIntlLocalesSupported; + +declare function areIntlLocalesSupported(locales: string | string[]): boolean; diff --git a/types/intl-locales-supported/intl-locales-supported-tests.ts b/types/intl-locales-supported/intl-locales-supported-tests.ts new file mode 100644 index 0000000000..9d63d0e9ec --- /dev/null +++ b/types/intl-locales-supported/intl-locales-supported-tests.ts @@ -0,0 +1,4 @@ +import areIntlLocalesSupported = require("intl-locales-supported"); + +areIntlLocalesSupported("en-GB"); +areIntlLocalesSupported([ "en-GB", "en-US" ]); diff --git a/types/intl-locales-supported/tsconfig.json b/types/intl-locales-supported/tsconfig.json new file mode 100644 index 0000000000..f528331ae4 --- /dev/null +++ b/types/intl-locales-supported/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "intl-locales-supported-tests.ts" + ] +} diff --git a/types/intl-locales-supported/tslint.json b/types/intl-locales-supported/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/intl-locales-supported/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index af86996795..fd602b18d9 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -13,6 +13,7 @@ // Ahn // Josh Goldberg // Bradley Ayers +// Andrew Makarov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -473,6 +474,11 @@ declare namespace jest { * to test what arguments it was last called with. */ toHaveBeenLastCalledWith(...params: any[]): R; + /** + * If you have a mock function, you can use `.toHaveBeenNthCalledWith` + * to test what arguments it was nth called with. + */ + toHaveBeenNthCalledWith(nthCall: number, ...params: any[]): R; /** * Used to check that an object has a `.length` property * and it is set to a certain numeric value. diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index a90a7a9e5a..09e9ecef99 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -731,3 +731,9 @@ test('moduleName 2', () => { const moduleName = require('../moduleName'); expect(moduleName()).toEqual(2); }); + +describe('toHaveBeenNthCalledWith', () => { + const fn = jest.fn(); + + expect(fn).toHaveBeenNthCalledWith(3, "foo"); +}); diff --git a/types/jsreport-html-to-xlsx/index.d.ts b/types/jsreport-html-to-xlsx/index.d.ts index 84b37480aa..83ac765c1f 100644 --- a/types/jsreport-html-to-xlsx/index.d.ts +++ b/types/jsreport-html-to-xlsx/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsreport-html-to-xlsx 1.4 +// Type definitions for jsreport-html-to-xlsx 2.0 // Project: https://github.com/jsreport/jsreport-html-to-xlsx // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,9 @@ import { ExtensionDefinition } from 'jsreport-core'; import { Options as BaseOptions } from 'jsreport-xlsx'; declare module 'jsreport-core' { + type htmlEngine = 'phantom' | 'chrome'; interface Template { + htmlToXlsx: { htmlEngine: htmlEngine; }; recipe: 'html-to-xlsx' | string; } } diff --git a/types/jsreport-html-to-xlsx/v1/index.d.ts b/types/jsreport-html-to-xlsx/v1/index.d.ts new file mode 100644 index 0000000000..84b37480aa --- /dev/null +++ b/types/jsreport-html-to-xlsx/v1/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for jsreport-html-to-xlsx 1.4 +// Project: https://github.com/jsreport/jsreport-html-to-xlsx +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { ExtensionDefinition } from 'jsreport-core'; +import { Options as BaseOptions } from 'jsreport-xlsx'; + +declare module 'jsreport-core' { + interface Template { + recipe: 'html-to-xlsx' | string; + } +} + +declare namespace JsReportHtml2Xlsx { + interface Options extends BaseOptions { + strategy: string; + } +} + +declare function JsReportHtml2Xlsx(options?: Partial): ExtensionDefinition; + +export = JsReportHtml2Xlsx; diff --git a/types/jsreport-html-to-xlsx/v1/jsreport-html-to-xlsx-tests.ts b/types/jsreport-html-to-xlsx/v1/jsreport-html-to-xlsx-tests.ts new file mode 100644 index 0000000000..9540cf7929 --- /dev/null +++ b/types/jsreport-html-to-xlsx/v1/jsreport-html-to-xlsx-tests.ts @@ -0,0 +1,19 @@ +import JsReport = require('jsreport-core'); +import JsreportHtml2Xlsx = require('jsreport-html-to-xlsx'); +import JsreportXlsx = require('jsreport-xlsx'); + +const jsreport = JsReport(); +jsreport.use(JsreportXlsx()); +jsreport.use(JsreportHtml2Xlsx()); + +(async () => { + const content = `
test
`; + await jsreport.init(); + const resp = await jsreport.render({ + template: { + content, + engine: 'none', + recipe: 'xlsx' + } + }); +})(); diff --git a/types/jsreport-html-to-xlsx/v1/tsconfig.json b/types/jsreport-html-to-xlsx/v1/tsconfig.json new file mode 100644 index 0000000000..6b073aa725 --- /dev/null +++ b/types/jsreport-html-to-xlsx/v1/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "esnext" + ], + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "jsreport-html-to-xlsx": [ "jsreport-html-to-xlsx/v1" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsreport-html-to-xlsx-tests.ts" + ] +} diff --git a/types/jsreport-html-to-xlsx/v1/tslint.json b/types/jsreport-html-to-xlsx/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsreport-html-to-xlsx/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/leaflet.locatecontrol/index.d.ts b/types/leaflet.locatecontrol/index.d.ts index 542461cec7..0afcd0d613 100644 --- a/types/leaflet.locatecontrol/index.d.ts +++ b/types/leaflet.locatecontrol/index.d.ts @@ -27,7 +27,7 @@ declare module 'leaflet' { drawMarker?: boolean; markerClass?: any; circleStyle?: PathOptions; - markerStyle?: PathOptions; + markerStyle?: PathOptions | MarkerOptions; followCircleStyle?: PathOptions; followMarkerStyle?: PathOptions; icon?: string; diff --git a/types/libxmljs/index.d.ts b/types/libxmljs/index.d.ts index ceeb1a3783..7fc9e9e2bf 100644 --- a/types/libxmljs/index.d.ts +++ b/types/libxmljs/index.d.ts @@ -1,114 +1,173 @@ -// Type definitions for Libxmljs v0.14.2 -// Project: https://github.com/polotek/libxmljs +// Type definitions for Libxmljs 0.18 +// Project: https://github.com/libxmljs/libxmljs // Definitions by: François de Campredon +// ComFreek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +import { EventEmitter } from 'events'; +export const version: string; +export const libxml_version: string; +export const libxml_parser_version: string; +// tslint:disable-next-line:strict-export-declare-modifiers +interface ParseOptions { + [optionName: string]: string; +} -import events = require('events'); +export function parseXml(source: string, options?: ParseOptions): Document; +export function parseXmlString(source: string, options?: ParseOptions): Document; -export declare function parseXml(source: string): XMLDocument; -export declare function parseHtml(source: string): HTMLDocument; -export declare function parseXmlString(source: string, options?: { [key: string]: string }): XMLDocument; -export declare function parseHtmlString(source: string): HTMLDocument; +export function parseHtml(source: string, options?: ParseOptions): Document; +export function parseHtmlString(source: string, options?: ParseOptions): Document; +export function parseHtmlFragment(source: string, options?: ParseOptions): Document; +export function memoryUsage(): number; +export function nodeCount(): number; -export declare class XMLDocument { - constructor(version: number, encoding: string); - child(idx: number): Element | undefined; +export class Document { + /** + * Create a new XML Document + * @param version XML document version, defaults to 1.0 + * @param encoding Encoding, defaults to utf8 + */ + constructor(version?: number, encoding?: string); + + errors: SyntaxError[]; + + child(idx: number): Element|null; childNodes(): Element[]; - errors(): SyntaxError[]; encoding(): string; - encoding(enc: string): void; + encoding(enc: string): this; find(xpath: string): Element[]; - get(xpath: string): Element | undefined; - node(name: string, content: string): Element; - root(): Element; - toString(): string; - validate(xsdDoc: XMLDocument): boolean; - validationErrors: XmlError[]; - version(): Number; + get(xpath: string): Element|null; + node(name: string, content?: string): Element; + root(): Element|null; + root(newRoot: Node): Node; + toString(formatted?: boolean): string; + type(): 'document'; + version(): string; + setDtd(name: string, ext: string, sys: string): void; + getDtd(): { + name: string; + externalId: string; + systemId: string; + }; } -export declare class HTMLDocument extends XMLDocument { +export class Node { + doc(): Document; + parent(): Element|Document; + /** + * The namespace or null in case of comment nodes + */ + namespace(): Namespace|null; + /** + * An array of namespaces that the object belongs to. + * + * @param local If it is true, only the namespace declarations local to this + * node are returned, rather than all of the namespaces in scope + * at this node (including the ones from the parent elements). + */ + namespaces(local?: boolean): Namespace[]; + + prevSibling(): Node|null; + nextSibling(): Node|null; + + type(): 'comment'|'element'|'text'|'attribute'; + remove(): this; + clone(): this; + /** + * Serializes the node to a string. The string will contain all contents of the node formatted as XML and can be used to print the node. + */ + toString(format?: boolean|{ + declaration: boolean; + selfCloseEmpty: boolean; + whitespace: boolean; + type: 'xml'|'html'|'xhtml' + }): string; } - -export declare class Element { - constructor(doc: XMLDocument, name: string, content?: string); +export class Element extends Node { + constructor(doc: Document, name: string, content?: string); + node(name: string, content?: string): Element; name(): string; - name(newName: string): void; + name(newName: string): this; text(): string; - attr(name: string): Attribute; - attr(attr: Attribute): void; - attr(attrObject: { [key: string]: string; }): void; + text(newText: string): this; + attr(name: string): Attribute|null; + attr(attrObject: { [key: string]: string; }): this; attrs(): Attribute[]; - parent(): Element; - doc(): XMLDocument; - child(idx: number): Element | undefined; - childNodes(): Element[]; - addChild(child: Element): Element; - nextSibling(): Element; - nextElement(): Element; - addNextSibling(siblingNode: Element): Element; - prevSibling(): Element; - prevElement(): Element; - addPrevSibling(siblingNode: Element): Element; - find(xpath: string): Element[]; - find(xpath: string, ns_uri: string): Element[]; - find(xpath: string, namespaces: { [key: string]: string; }): Element[]; - get(xpath: string): Element | undefined; - get(xpath: string, ns_uri: string): Element | undefined; - get(xpath: string, ns_uri: { [key: string]: string; }): Element | undefined; - defineNamespace(href: string): Namespace; - defineNamespace(prefix: string, href: string): Namespace; - namespace(): Namespace; - namespace(ns: Namespace): void; - namespace(href: string): void; - namespace(prefix: string, href: string): void; - remove(): void; + + doc(): Document; + child(idx: number): Node | null; + childNodes(): Node[]; + + /** + * @return The original element, not the child. + */ + addChild(child: Element): this; + + prevElement(): Element|null; + nextElement(): Element|null; + addNextSibling(siblingNode: Node): Node; + + find(xpath: string, ns_uri?: string): Node[]; + find(xpath: string, namespaces: { [key: string]: string; }): Node[]; + get(xpath: string, ns_uri?: string): Element|null; + + defineNamespace(prefixOrHref: string, hrefInCaseOfPrefix?: string): Namespace; + + namespace(): Namespace|null; + namespace(newNamespace: Namespace): this; + namespace(prefixOrHref: string, hrefInCaseOfPrefix?: string): Namespace; + + replace(replacement: string): string; + replace(replacement: Element): Element; + path(): string; - type(): string; } - -export declare class Attribute { - constructor(node: Element, name: string, value: string); - constructor(node: Element, name: string, value: string, ns: Namespace); +export class Attribute { name(): string; - namespace(): Namespace; - namespace(ns: Namespace): Namespace; - nextSibling(): Attribute; - node(): Element; - prevSibling(): Attribute; - remove(): void; value(): string; + value(newValue: string): Attribute; + namespace(): Namespace; + + remove(): void; } -export declare class Namespace { - constructor(node: Element, prefix: string, href: string); +export class Namespace { href(): string; prefix(): string; } -export declare class SaxParser extends events.EventEmitter { +export class SaxParser extends EventEmitter { + constructor(); parseString(source: string): boolean; } - -export declare class SaxPushParser extends events.EventEmitter { +export class SaxPushParser extends EventEmitter { + constructor(); push(source: string): boolean; } -export interface XmlError { - domain: number; - code: number; - message: string; - level: number; - file?: string; +export interface SyntaxError { + domain: number|null; + code: number|null; + message: string|null; + level: number|null; + file: string|null; + line: number|null; + /** + * 1-based column number, 0 if not applicable/available. + */ column: number; - line: number; + + str1: number|null; + str2: number|null; + str3: number|null; + int1: number|null; } diff --git a/types/libxmljs/libxmljs-tests.ts b/types/libxmljs/libxmljs-tests.ts index 87d634aab4..367d74c69d 100644 --- a/types/libxmljs/libxmljs-tests.ts +++ b/types/libxmljs/libxmljs-tests.ts @@ -1,7 +1,6 @@ +import * as libxmljs from 'libxmljs'; - -var libxmljs = require("libxmljs"); -var xml = '' + +const xml = '' + '' + '' + 'grandchild content' + @@ -9,40 +8,42 @@ var xml = '' + 'with content!' + ''; -var xmlDoc = libxmljs.parseXml(xml); +const xmlDoc = libxmljs.parseXml(xml); // xpath queries -var gchild = xmlDoc.get('//grandchild'); +const gchild = xmlDoc.get('//grandchild')!; console.log(gchild.text()); // prints "grandchild content" -var children = xmlDoc.root().childNodes(); -var child = children[0]; +const children = xmlDoc.root()!.childNodes(); +const child = children[0] as libxmljs.Element; -console.log(child.attr('foo').value()); // prints "bar" +console.log(child.attr('foo')!.value()); // prints "bar" -var parser = new libxmljs.SaxParser(); +const parser = new libxmljs.SaxParser(); -parser.on('startDocument', null); -parser.on('startElement', null); +parser.on('startDocument', () => 0); +parser.on('startElement', () => 0); -var parser2 = new libxmljs.SaxPushParser(); +const parser2 = new libxmljs.SaxPushParser(); // connect any callbacks here parser2 - .on('startDocument', null) - .on('startElement', null) + .on('startDocument', () => 0) + .on('startElement', () => 0); -var xmlChunk: any; +const xmlChunk = ''; -while(xmlChunk) { +while (xmlChunk) { parser2.push(xmlChunk); } -var doc = new libxmljs.Document(); - doc.node('root') +const doc = new libxmljs.Document(); + ((doc.node('root') .node('child').attr({foo: 'bar'}) .node('grandchild', 'grandchild content').attr({baz: 'fizbuzz'}) .parent() - .parent() + ) as libxmljs.Element).parent() .node('sibling', 'with content!'); + +const {name, externalId, systemId} = doc.getDtd(); diff --git a/types/libxmljs/tsconfig.json b/types/libxmljs/tsconfig.json index 7201fffe81..45835560c6 100644 --- a/types/libxmljs/tsconfig.json +++ b/types/libxmljs/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/libxmljs/tslint.json b/types/libxmljs/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/libxmljs/tslint.json +++ b/types/libxmljs/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } diff --git a/types/libxslt/index.d.ts b/types/libxslt/index.d.ts index 329525d7df..3b400d08e7 100644 --- a/types/libxslt/index.d.ts +++ b/types/libxslt/index.d.ts @@ -1,59 +1,37 @@ -// Type definitions for node-libxslt +// Type definitions for node-libxslt 0.7 // Project: https://github.com/albanm/node-libxslt // Definitions by: Alejandro Sánchez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// +// TypeScript Version: 2.2 import * as xmljs from 'libxmljs'; +import { + ApplyCallback, + ApplyResult, + ApplyStringCallback, + OutputFormat, + ParseCallback +} from './internal-types'; export const libxmljs: typeof xmljs; -type OutputFormat = 'document' | 'string'; - export interface ApplyOptions { outputFormat?: OutputFormat; noWrapParams?: boolean; } -type ApplyResult = string | xmljs.XMLDocument; - -type ApplyCallback = (err: Error, result: ApplyResult) => void; - -type ApplyStringCallback = (err: Error, result: string) => void; - -type ApplyDocumentCallback = (err: Error, result: xmljs.XMLDocument) => void; - export interface Stylesheet { - apply(source: string, params?: Object): string; - - apply(source: string, params: Object, options: ApplyOptions): ApplyResult; - - apply(source: string, params: Object, options: ApplyOptions, callback: ApplyCallback): void; - - apply(source: string, callback: ApplyStringCallback): void; - - apply(source: xmljs.XMLDocument, params?: Object): xmljs.XMLDocument; - - apply(source: xmljs.XMLDocument, params: Object, options: ApplyOptions): ApplyResult; - - apply(source: xmljs.XMLDocument, params: Object, options: ApplyOptions, callback: ApplyCallback): void; - - apply(source: xmljs.XMLDocument, callback: ApplyDocumentCallback): void; - - applyToFile(sourcePath: string, params: Object, options: ApplyOptions, callback: ApplyStringCallback): void; + apply(source: string, params?: object): string; + apply(source: string|xmljs.Document, params: object, options: ApplyOptions): ApplyResult; + apply(source: string|xmljs.Document, params: object, options: ApplyOptions, callback: ApplyCallback): void; + apply(source: string|xmljs.Document, callback: ApplyStringCallback): void; + apply(source: xmljs.Document, params?: object): xmljs.Document; + applyToFile(sourcePath: string, params: object, options: ApplyOptions, callback: ApplyStringCallback): void; applyToFile(sourcePath: string, callback: ApplyStringCallback): void; } -type ParseCallback = (err: Error, stylesheet: Stylesheet) => void; - -export function parse(source: string): Stylesheet; - -export function parse(source: string, callback: ParseCallback): void; - -export function parse(source: xmljs.XMLDocument): Stylesheet; - -export function parse(source: xmljs.XMLDocument, callback: ParseCallback): void; +export function parse(source: string|xmljs.Document): Stylesheet; +export function parse(source: string|xmljs.Document, callback: ParseCallback): void; export function parseFile(sourcePath: string, callback: ParseCallback): void; diff --git a/types/libxslt/internal-types.d.ts b/types/libxslt/internal-types.d.ts new file mode 100644 index 0000000000..a0d4041e52 --- /dev/null +++ b/types/libxslt/internal-types.d.ts @@ -0,0 +1,11 @@ +import * as xmljs from 'libxmljs'; +import { Stylesheet } from './index'; + +export type OutputFormat = 'document' | 'string'; + +export type ApplyResult = string | xmljs.Document; +export type ApplyCallback = (err: Error, result: ApplyResult) => void; +export type ApplyStringCallback = (err: Error, result: string) => void; +export type ApplyDocumentCallback = (err: Error, result: xmljs.Document) => void; + +export type ParseCallback = (err: Error, stylesheet: Stylesheet) => void; diff --git a/types/libxslt/libxslt-tests.ts b/types/libxslt/libxslt-tests.ts index bed54e5f52..1530ad0eb1 100644 --- a/types/libxslt/libxslt-tests.ts +++ b/types/libxslt/libxslt-tests.ts @@ -1,7 +1,7 @@ import * as libxslt from 'libxslt'; import * as libxmljs from 'libxmljs'; -const document: libxmljs.XMLDocument = libxslt.libxmljs.parseXmlString(''); +const document: libxmljs.Document = libxslt.libxmljs.parseXmlString(''); let stylesheet: libxslt.Stylesheet; @@ -36,7 +36,7 @@ applyOptions = { let transformedString: string; -let transformedDocument: libxmljs.XMLDocument; +let transformedDocument: libxmljs.Document; transformedString = stylesheet.apply(''); diff --git a/types/libxslt/tsconfig.json b/types/libxslt/tsconfig.json index a7f7f94ffc..00f8d27037 100644 --- a/types/libxslt/tsconfig.json +++ b/types/libxslt/tsconfig.json @@ -18,6 +18,7 @@ }, "files": [ "index.d.ts", + "internal-types.d.ts", "libxslt-tests.ts" ] } \ No newline at end of file diff --git a/types/libxslt/tslint.json b/types/libxslt/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/libxslt/tslint.json +++ b/types/libxslt/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } diff --git a/types/next/index.d.ts b/types/next/index.d.ts index 34bdba9047..fe44537f5f 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/zeit/next.js // Definitions by: Drew Hays // Brice BERNARD +// Scott Jones // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/next/router.d.ts b/types/next/router.d.ts index 181208518f..544c29bc7e 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -9,10 +9,7 @@ export interface EventChangeOptions { } export type RouterCallback = () => void; -export interface SingletonRouter { - readyCallbacks: RouterCallback[]; - ready(cb: RouterCallback): void; - +export interface RouterProps { // router properties readonly components: { [key: string]: { Component: React.ComponentType; err: any }; @@ -53,9 +50,16 @@ export interface SingletonRouter { onRouteChangeError?(error: any, url: string): void; } +export interface SingletonRouter { + router: RouterProps; + readyCallbacks: RouterCallback[]; + ready(cb: RouterCallback): void; +} + export function withRouter( - Component: React.ComponentType, + Component: React.ComponentType, ): React.ComponentType; export const Singleton: SingletonRouter; +export type ImperativeRouter = RouterProps; export default Singleton; diff --git a/types/next/test/next-router-tests.tsx b/types/next/test/next-router-tests.tsx index fe82d6f0b2..822b9b8e6f 100644 --- a/types/next/test/next-router-tests.tsx +++ b/types/next/test/next-router-tests.tsx @@ -13,8 +13,8 @@ Router.ready(() => { // Access readonly properties of the router. -Object.keys(Router.components).forEach(key => { - const c = Router.components[key]; +Object.keys(Router.router.components).forEach(key => { + const c = Router.router.components[key]; c.err.isAnAny; return ; @@ -26,51 +26,51 @@ function split(routeLike: string) { }); } -if (Router.asPath) { - split(Router.asPath); - split(Router.asPath); +if (Router.router.asPath) { + split(Router.router.asPath); + split(Router.router.asPath); } -split(Router.pathname); +split(Router.router.pathname); -const query = `?${qs.stringify(Router.query)}`; +const query = `?${qs.stringify(Router.router.query)}`; // Assign some callback methods. -Router.onAppUpdated = (nextRoute: string) => console.log(nextRoute); -Router.onRouteChangeStart = (url: string) => +Router.router.onAppUpdated = (nextRoute: string) => console.log(nextRoute); +Router.router.onRouteChangeStart = (url: string) => console.log("Route is starting to change.", url); -Router.onBeforeHistoryChange = (as: string) => +Router.router.onBeforeHistoryChange = (as: string) => console.log("History hasn't changed yet.", as); -Router.onRouteChangeComplete = (url: string) => +Router.router.onRouteChangeComplete = (url: string) => console.log("Route chaneg is complete.", url); -Router.onRouteChangeError = (err: any, url: string) => +Router.router.onRouteChangeError = (err: any, url: string) => console.log("Route is starting to change.", url, err); // Call methods on the router itself. -Router.reload("/route").then(() => console.log("route was reloaded")); -Router.back(); +Router.router.reload("/route").then(() => console.log("route was reloaded")); +Router.router.back(); -Router.push("/route").then((success: boolean) => +Router.router.push("/route").then((success: boolean) => console.log("route push success: ", success), ); -Router.push("/route", "/asRoute").then((success: boolean) => +Router.router.push("/route", "/asRoute").then((success: boolean) => console.log("route push success: ", success), ); -Router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) => +Router.router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) => console.log("route push success: ", success), ); -Router.replace("/route").then((success: boolean) => +Router.router.replace("/route").then((success: boolean) => console.log("route replace success: ", success), ); -Router.replace("/route", "/asRoute").then((success: boolean) => +Router.router.replace("/route", "/asRoute").then((success: boolean) => console.log("route replace success: ", success), ); -Router.replace("/route", "/asRoute", { +Router.router.replace("/route", "/asRoute", { shallow: false, }).then((success: boolean) => console.log("route replace success: ", success)); -Router.prefetch("/route").then(Component => { +Router.router.prefetch("/route").then(Component => { const element = ; }); diff --git a/types/nodegit/diff-binary-file.d.ts b/types/nodegit/diff-binary-file.d.ts index 46b67f406e..362e1a63fc 100644 --- a/types/nodegit/diff-binary-file.d.ts +++ b/types/nodegit/diff-binary-file.d.ts @@ -1,5 +1,7 @@ +import { Object } from './object'; + export class DiffBinaryFile { - type: number; + type: Object.TYPE; data: string; datalen: number; inflatedlen: number; diff --git a/types/nodegit/object.d.ts b/types/nodegit/object.d.ts index 4ec5a19b6c..be7e879b95 100644 --- a/types/nodegit/object.d.ts +++ b/types/nodegit/object.d.ts @@ -3,20 +3,35 @@ import { Repository } from './repository'; import { Buf } from './buf'; export class Object { - static size(type: number): number; - static lookup(repo: Repository, id: Oid, type: number): Promise; - static lookupPrefix(repo: Repository, id: Oid, len: number, type: number): Promise; - static string2type(str: string): number; - static type2string(type: number): string; - static typeisloose(type: number): number; + static size(type: Object.TYPE): number; + static lookup(repo: Repository, id: Oid, type: Object.TYPE): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number, type: Object.TYPE): Promise; + static string2Type(str: string): Object.TYPE; + static type2String(type: Object.TYPE): string; + static typeisloose(type: Object.TYPE): number; dup(): Promise; free(): void; id(): Oid; - lookupByPath(path: string, type: number): Promise; + lookupByPath(path: string, type: Object.TYPE): Promise; owner(): Repository; peel(targetType: number): Promise; shortId(): Promise; type(): number; } + +export namespace Object { + const enum TYPE { + ANY = -2, + BAD = -1, + EXT1 = 0, + COMMIT = 1, + TREE = 2, + BLOB = 3, + TAG = 4, + EXT2 = 5, + OFS_DELTA = 6, + REF_DELTA = 7 + } +} diff --git a/types/nodegit/odb-expand-id.d.ts b/types/nodegit/odb-expand-id.d.ts index d4fe264c3a..5576fbad58 100644 --- a/types/nodegit/odb-expand-id.d.ts +++ b/types/nodegit/odb-expand-id.d.ts @@ -1,7 +1,8 @@ import { Oid } from './oid'; +import { Object } from './object'; export class OdbExpandId { id: Oid; length: number; - type: number; + type: Object.TYPE; } diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index db0aacda61..e5348d088f 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -1,6 +1,7 @@ import { Oid } from './oid'; import { OdbObject } from './odb-object'; import { OdbExpandId } from './odb-expand-id'; +import { Object } from './object'; export namespace Odb { const enum STREAM { @@ -17,6 +18,6 @@ export class Odb { free(): void; read(id: Oid): Promise; - write(data: Buffer, len: number, type: number): Promise; + write(data: Buffer, len: number, type: Object.TYPE): Promise; expandIds(ids: OdbExpandId, count: number): number; } diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts index 80e16c9350..cc6cb90e28 100644 --- a/types/nodegit/reference.d.ts +++ b/types/nodegit/reference.d.ts @@ -41,7 +41,7 @@ export class Reference { isTag(): number; name(): string; owner(): Repository; - peel(type: number): Promise; + peel(type: Object.TYPE): Promise; rename(newName: string, force: number, logMessage: string): Promise; resolve(): Promise; setTarget(id: Oid, logMessage: string): Promise; diff --git a/types/qrcode/index.d.ts b/types/qrcode/index.d.ts index c04a07c20f..5d607b2908 100644 --- a/types/qrcode/index.d.ts +++ b/types/qrcode/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for qrcode 0.8.2 +// Type definitions for qrcode 1.2 // Project: https://github.com/soldair/node-qrcode -// Definitions by: York Yao +// Definitions by: York Yao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -22,7 +22,7 @@ export interface QRCodeOptions { * Helper function used internally to convert a kanji to its Shift JIS value. * Provide this function if you need support for Kanji mode. */ - toSJISFunc?: Function; + toSJISFunc?: (codePoint: string) => number; } export interface QRCodeToDataURLOptions extends QRCodeRenderersOptions { @@ -40,7 +40,7 @@ export interface QRCodeToDataURLOptions extends QRCodeRenderersOptions { }; } -export interface QRCodeToStringOptions extends QRCodeOptions { +export interface QRCodeToStringOptions extends QRCodeRenderersOptions { /** * Output format. * Default: utf8 @@ -127,10 +127,6 @@ export interface QRCode { */ export function create(text: string | QRCodeSegment[], options: QRCodeOptions): QRCode; -/** - * Draws qr code symbol to canvas. - */ -export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[]): Promise; /** * Draws qr code symbol to canvas. */ @@ -138,15 +134,11 @@ export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCode /** * Draws qr code symbol to canvas. */ -export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeOptions): Promise; +export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options?: QRCodeOptions): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error) => void): void; -/** - * Draws qr code symbol to canvas. - */ -export function toCanvas(text: string | QRCodeSegment[]): Promise; /** * Draws qr code symbol to canvas. */ @@ -154,15 +146,11 @@ export function toCanvas(text: string | QRCodeSegment[], callback: (error: Error /** * Draws qr code symbol to canvas. */ -export function toCanvas(text: string | QRCodeSegment[], options: QRCodeOptions): Promise; +export function toCanvas(text: string | QRCodeSegment[], options?: QRCodeOptions): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error, canvas: HTMLCanvasElement) => void): void; -/** - * Draws qr code symbol to node canvas. - */ -export function toCanvas(canvas: any, text: string | QRCodeSegment[]): Promise; /** * Draws qr code symbol to node canvas. */ @@ -170,16 +158,12 @@ export function toCanvas(canvas: any, text: string | QRCodeSegment[], callback: /** * Draws qr code symbol to node canvas. */ -export function toCanvas(canvas: any, text: string | QRCodeSegment[], options: QRCodeOptions): Promise; +export function toCanvas(canvas: any, text: string | QRCodeSegment[], options?: QRCodeOptions): Promise; /** * Draws qr code symbol to node canvas. */ export function toCanvas(canvas: any, text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error) => void): void; -/** - * Returns a Data URI containing a representation of the QR Code image. - */ -export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[]): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ @@ -187,15 +171,12 @@ export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCod /** * Returns a Data URI containing a representation of the QR Code image. */ -export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeToDataURLOptions): Promise; +export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options?: QRCodeToDataURLOptions): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void; -/** - * Returns a Data URI containing a representation of the QR Code image. - */ -export function toDataURL(text: string | QRCodeSegment[]): Promise; + /** * Returns a Data URI containing a representation of the QR Code image. */ @@ -203,17 +184,12 @@ export function toDataURL(text: string | QRCodeSegment[], callback: (error: Erro /** * Returns a Data URI containing a representation of the QR Code image. */ -export function toDataURL(text: string | QRCodeSegment[], options: QRCodeToDataURLOptions): Promise; +export function toDataURL(text: string | QRCodeSegment[], options?: QRCodeToDataURLOptions): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void; -/** - * Returns a string representation of the QR Code. - * If choosen output format is svg it will returns a string containing xml code. - */ -export function toString(text: string | QRCodeSegment[]): Promise; /** * Returns a string representation of the QR Code. * If choosen output format is svg it will returns a string containing xml code. @@ -223,19 +199,13 @@ export function toString(text: string | QRCodeSegment[], callback: (error: Error * Returns a string representation of the QR Code. * If choosen output format is svg it will returns a string containing xml code. */ -export function toString(text: string | QRCodeSegment[], options: QRCodeToStringOptions): Promise; +export function toString(text: string | QRCodeSegment[], options?: QRCodeToStringOptions): Promise; /** * Returns a string representation of the QR Code. * If choosen output format is svg it will returns a string containing xml code. */ export function toString(text: string | QRCodeSegment[], options: QRCodeToStringOptions, callback: (error: Error, string: string) => void): void; -/** - * Saves QR Code to image file. - * If options.type is not specified, the format will be guessed from file extension. - * Recognized extensions are png, svg, txt. - */ -export function toFile(path: string, text: string | QRCodeSegment[]): Promise; /** * Saves QR Code to image file. * If options.type is not specified, the format will be guessed from file extension. @@ -247,7 +217,7 @@ export function toFile(path: string, text: string | QRCodeSegment[], callback: ( * If options.type is not specified, the format will be guessed from file extension. * Recognized extensions are png, svg, txt. */ -export function toFile(path: string, text: string | QRCodeSegment[], options: QRCodeToFileOptions): Promise; +export function toFile(path: string, text: string | QRCodeSegment[], options?: QRCodeToFileOptions): Promise; /** * Saves QR Code to image file. * If options.type is not specified, the format will be guessed from file extension. @@ -255,10 +225,6 @@ export function toFile(path: string, text: string | QRCodeSegment[], options: QR */ export function toFile(path: string, text: string | QRCodeSegment[], options: QRCodeToFileOptions, callback: (error: Error) => void): void; -/** - * Writes QR Code image to stream. Only works with png format for now. - */ -export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[]): Promise; /** * Writes QR Code image to stream. Only works with png format for now. */ @@ -266,7 +232,7 @@ export function toFileStream(stream: stream.Writable, text: string | QRCodeSegme /** * Writes QR Code image to stream. Only works with png format for now. */ -export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], options: QRCodeOptions): Promise; +export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], options?: QRCodeOptions): Promise; /** * Writes QR Code image to stream. Only works with png format for now. */ diff --git a/types/qrcode/qrcode-tests.ts b/types/qrcode/qrcode-tests.ts index 6a94a5f580..363367cc28 100644 --- a/types/qrcode/qrcode-tests.ts +++ b/types/qrcode/qrcode-tests.ts @@ -2,31 +2,31 @@ import * as QRCode from 'qrcode'; const canvas = document.getElementById('canvas') as HTMLCanvasElement; -QRCode.toCanvas(canvas, 'sample text', function (error) { - if (error) console.error(error) +QRCode.toCanvas(canvas, 'sample text', (error) => { + if (error) console.error(error); console.log('success!'); }); -QRCode.toDataURL('I am a pony!', function (err, url) { +QRCode.toDataURL('I am a pony!', (err, url) => { console.log(url); }); -QRCode.toDataURL('some text', { errorCorrectionLevel: 'H' }, function (err, url) { +QRCode.toDataURL('some text', { errorCorrectionLevel: 'H' }, (err, url) => { console.log(url); }); -QRCode.toDataURL('some text', { version: 2 }, function (err, url) { +QRCode.toDataURL('some text', { version: 2 }, (err, url) => { console.log(url); }); QRCode.toDataURL([ { data: 'ABCDEFG', mode: 'alphanumeric' }, { data: '0123456', mode: 'numeric' } -], function (err, url) { +], (err, url) => { console.log(url); }); -QRCode.toCanvas('text', { errorCorrectionLevel: 'H' }, function (err, canvas) { +QRCode.toCanvas('text', { errorCorrectionLevel: 'H' }, (err, canvas) => { if (err) throw err; }); @@ -36,11 +36,11 @@ QRCode.toDataURL('text', { rendererOpts: { quality: 0.3 } -}, function (err, url) { +}, (err, url) => { if (err) throw err; }); -QRCode.toString('http://www.google.com', function (err, string) { +QRCode.toString('http://www.google.com', (err, string) => { if (err) throw err; console.log(string); }); @@ -50,7 +50,7 @@ QRCode.toFile('path/to/filename.png', 'Some text', { dark: '#00F', // Blue dots light: '#0000' // Transparent background } -}, function (err) { +}, (err) => { if (err) throw err; console.log('done'); }); diff --git a/types/qrcode/tslint.json b/types/qrcode/tslint.json index a41bf5d19a..08b1465cd6 100644 --- a/types/qrcode/tslint.json +++ b/types/qrcode/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "unified-signatures": false } } diff --git a/types/re-base/index.d.ts b/types/re-base/index.d.ts new file mode 100644 index 0000000000..4367476b9b --- /dev/null +++ b/types/re-base/index.d.ts @@ -0,0 +1,661 @@ +// Type definitions for re-base 3.2 +// Project: https://github.com/tylermcginnis/re-base#readme +// Definitions by: jordandrako +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export interface RebaseBinding { + context: object; + endpoint: string; + id: number; + method: string; +} + +export interface SyncStateOptions { + /** + * The context of your component. + */ + context: object; + + /** + * The state property you want to sync with Firebase; can be an + * arbitrarily nested property a là `foo.bar`. + */ + state: string; + + /** + * A default value to set when the Firebase endpoint has no value (i.e., + * on init) (use this if you want a value other than an empty object or + * empty array) + */ + defaultValue?: string | boolean | number | object; + + /** + * Returns the Firebase data at the specified endpoint as an Array + * instead of an Object. + */ + asArray?: boolean; + + /** + * Will keep any firebase generated keys intact when manipulating data + * using the asArray option. + */ + keepKeys?: boolean; + + /** + * Queries to be used with your read operations. See + * [Query Options](https://github.com/tylermcginnis/re-base#queries) + * for more details. + */ + queries?: object; + + /** + * The callback function that will be invoked when the initial listener + * is established with Firebase. Typically used (with syncState) to + * change this.state.loading to false. + */ + then?: () => void; + + /** + * A callback function that will be invoked if the current user does + * not have read or write permissions at the location. + */ + onFailure?: () => void; +} + +export interface BindToStateOptions { + /** + * The context of your component. + */ + context: object; + + /** + * The state property you want to sync with Firebase; can be an + * arbitrarily nested property a là `foo.bar` (no arrays). + */ + state: string; + + /** + * Returns the Firebase data at the specified endpoint as an Array + * instead of an Object. + */ + asArray?: boolean; + + /** + * Queries to be used with your read operations. See + * [Query Options](https://github.com/tylermcginnis/re-base#queries) + * for more details. + */ + queries?: object; + + /** + * The callback function that will be invoked when the initial listener + * is established with Firebase. Typically used (with bindToState) to + * change this.state.loading to false. + */ + then?: () => void; + + /** + * A callback function that will be invoked if the current user does + * not have read permissions at the location. + */ + onFailure?: () => void; +} + +export interface ListenToOptions { + /** + * The context of your component. + */ + context: object; + + /** + * Returns the Firebase data at the specified endpoint as an Array + * instead of an Object. + */ + asArray?: boolean; + + /** + * The callback function that will be invoked with the data from the + * specified endpoint when the endpoint changes. + */ + then: (result: any) => void; + + /** + * The callback function that will be invoked if the current user does + * not have read permissions at the location. + */ + onFailure?: (error: any) => void; + + /** + * Queries to be used with your read operations. See + * [Query Options](https://github.com/tylermcginnis/re-base#queries) + * for more details. + */ + queries?: object; +} + +export interface FetchOptions { + /** + * The context of your component. + */ + context: object; + + /** + * Returns the Firebase data at the specified endpoint as an Array + * instead of an Object. + */ + asArray?: boolean; + + /** + * The callback function that will be invoked with the data from the + * specified endpoint when the endpoint changes. + */ + then?: (result: any) => void; + + /** + * The callback function that will be invoked with an error that occurs + * reading data from the specified endpoint. + */ + onFailure?: () => void; + + /** + * Queries to be used with your read operations. See + * [Query Options](https://github.com/tylermcginnis/re-base#queries) + * for more details. + */ + queries?: object; +} + +export interface PostOptions { + /** + * The data you're wanting to persist to Firebase. + */ + data: any; + + /** + * A callback that will get invoked once the new data has been saved to + * Firebase. If there is an error, it will be the only argument to this + * function. + */ + then?: (result: any) => void; +} + +export interface PushOptions { + /** + * The data you're wanting to persist to Firebase. + */ + data: any; + + /** + * A callback that will get invoked once the new data has been saved to + * Firebase. If there is an error, it will be the only argument to this + * function. + */ + then?: (result: any) => void; +} + +export interface UpdateOptions { + /** + * The data you're wanting to persist to Firebase. + */ + data: any; + + /** + * A callback that will get invoked once the new data has been saved to + * Firebase. If there is an error, it will be the only argument to this + * function. + */ + then?: (result: any) => void; +} + +export interface bindDocOptions { + /** + * The context of your component. + */ + context: object; + + /** + * A property name on your state to bind your document to, if omitted + * the document will be merged into your existing state. + */ + state?: string; + + /** + * A callback that will be called when the listener is set, use for + * loading indicators. + */ + then?: () => void; + + /** + * A callback that will be called with any errors such as permissions + * errors. + */ + onFailure?: () => void; +} + +export interface listenToDocOptions { + /** + * The context of your component. + */ + context: object; + + /** + * A callback that will be called when the listener is set, use for + * loading indicators. + */ + then?: () => void; + + /** + * A callback that will be called with any errors such as permissions + * errors. + */ + onFailure?: () => void; +} + +export interface bindCollectionOptions { + /** + * The context of your component. + */ + context: object; + + /** + * The state property to bind the collection to. + */ + state?: string; + + /** + * A function that receives the created ref as its only argument. You + * can chain any Firestore queries you want to perform. See + * [Using Firestore Queries](https://github.com/tylermcginnis/re-base#firestorequeries). + */ + query?: () => void; + + /** + * Will embed firestore generated document ids inside each document in + * your collections on the `id` property. + */ + withIds?: boolean; + + /** + * will embed the DocumentReference inside each document in your + * collection on the `ref` property. + */ + withRefs?: boolean; + + /** + * A callback that will be called when the listener is set, use for + * loading indicators. + */ + then?: () => void; + + /** + * A callback that will be called with any errors such as permissions + * errors. + */ + onFailure?: () => void; +} + +export interface listenToCollectionOptions { + /** + * The context of your component. + */ + context: object; + + /** + * A callback that will be called with the data. + */ + then: () => void; + + /** + * A function that receives the created ref as its only argument. You + * can chain any Firestore queries you want to perform. See + * [Using Firestore Queries](https://github.com/tylermcginnis/re-base#firestorequeries). + */ + query?: () => void; + + /** + * Will embed firestore generated document ids inside each document in + * your collections on the `id` property. + */ + withIds?: boolean; + + /** + * will embed the DocumentReference inside each document in your + * collection on the `ref` property. + */ + withRefs?: boolean; + + /** + * A callback that will be called with any errors such as permissions + * errors. + */ + onFailure?: () => void; +} + +export interface getOptions { + /** + * A function that receives the created ref as its only argument. You + * can chain any Firestore queries you want to perform. See + * [Using Firestore Queries](https://github.com/tylermcginnis/re-base#firestorequeries). + */ + query?: () => void; + + /** + * Will embed firestore generated document ids inside each document in + * your collections on the `id` property. + */ + withIds?: boolean; + + /** + * will embed the DocumentReference inside each document in your + * collection on the `ref` property. + */ + withRefs?: boolean; +} + +export interface removeFromCollectionOptions { + /** + * A function that receives the created ref as its only argument. You + * can chain any Firestore queries you want to perform. See + * [Using Firestore Queries](https://github.com/tylermcginnis/re-base#firestorequeries). + */ + query?: () => void; +} + +export interface syncDocOptions { + /** + * The context of your component. + */ + context: object; + + /** + * The state property to sync. + */ + state: string; + + /** + * A callback that will be called when the listener is set, use for + * loading indicators. + */ + then?: () => void; + + /** + * A callback that will be called with any errors such as permissions + * errors. + */ + onFailure?: () => void; +} + +export interface Rebase { + /** + * This property contains the initialized firebase app that was passed + * into re-base. You can access any of the firebase services that you + * are using off this object. For instance, if you want to use some + * firebase database methods that re-base doesn't have helpers for or + * if you are using the auth service and want to quickly access it off + * of re-base. + */ + initializedApp: object; + + /** + * This property contains an object that you can use when adding data + * that will be converted to a timestamp by Firebase. See + * [the docs](https://firebase.google.com/docs/reference/js/firebase.database.ServerValue) + * for more info. + */ + timestamp: object; + + /** + * Allows you to set up two way data binding between your component's + * state and your Firebase. Whenever your Firebase changes, your + * component's state will change. Whenever your component's state + * changes, Firebase will change. + * @param endpoint The relative Firebase endpoint to which you'd like + * to bind your component's state. + * @param options syncState Options. + * @returns An object which you can pass to `removeBinding` if you want + * to remove the listener while the component is still mounted. + */ + syncState(endpoint: string, options: SyncStateOptions): RebaseBinding; + + /** + * One way data binding from Firebase to your component's state. Allows + * you to bind a component's state property to a Firebase endpoint so + * whenever that Firebase endpoint changes, your component's state will + * be updated with that change. + * @param endpoint The relative Firebase endpoint that you'd like to + * bind to your component's state. + * @param options bindToState Options. + * @returns An object which you can pass to `removeBinding` if you want + * to remove the listener while the component is still mounted. + */ + bindToState(endpoint: string, options: BindToStateOptions): RebaseBinding; + + /** + * Allows you to listen to Firebase endpoints without binding those + * changes to a state property. Instead, a callback will be invoked + * with the newly updated data. + * @param endpoint The relative Firebase endpoint which contains the + * data with which you'd like to invoke your callback function. + * @param options listenTo Options. + * @returns An object which you can pass to `removeBinding` when your + * component unmounts to remove the Firebase listeners. + */ + listenTo(endpoint: string, options: ListenToOptions): RebaseBinding; + + /** + * Allows you to retrieve the data from a Firebase endpoint just once + * without subscribing or listening for data changes. + * @param endpoint The relative Firebase endpoint which contains the + * data you're wanting to fetch. + * @param options fetch Options. + * @returns A Firebase [Promise](https://firebase.google.com/docs/reference/js/firebase.Promise) + * which resolves when the write is complete and rejects if there is an + * error. + */ + fetch(endpoint: string, options: FetchOptions): Promise; + + /** + * Allows you to update a Firebase endpoint with new data. *Replace all + * the data at this endpoint with the new data*. + * @param endpoint The relative Firebase endpoint that you'd like to + * update with the new data. + * @param options post Options. + * @returns A Firebase [Promise](https://firebase.google.com/docs/reference/js/firebase.Promise) + * which resolves when the write is complete and rejects if there is an + * error. + */ + post(endpoint: string, options: PostOptions): Promise; + + /** + * Allows you to add data to a Firebase endpoint. *Adds data to a child + * of the endpoint with a new Firebase push key*. + * @param endpoint The relative Firebase endpoint that you'd like to + * push the new data to. + * @param options push Options. + * @returns A Firebase [ThenableReference](https://firebase.google.com/docs/reference/js/firebase.database.ThenableReference) + * which is defined by Firebase as a "Combined Promise and reference; + * resolves when write is complete, but can be used immediately as the + * reference to the child location." + */ + push(endpoint: string, options: PushOptions): Promise; + + /** + * Allows you to update data at a Firebase endpoint changing only the + * properties you pass to it. **Warning: calling update with + * `options.data` being null will remove all the data at that + * endpoint**. + * @param endpoint The relative Firebase endpoint that you'd like to + * update. + * @param options update Options. + * @returns A Firebase [Promise](https://firebase.google.com/docs/reference/js/firebase.Promise) + * which resolves when the write is complete and rejects if there is an + * error. + */ + update(endpoint: string, options: UpdateOptions): Promise; + + /** + * Allows you to delete all data at the endpoint location. + * @param endpoint The relative Firebase endpoint that you'd like to + * delete data from. + * @param callback A callback that will get invoked once the data is + * successfully removed Firebase. If there is an error, it will be the + * only argument to this function. + * @returns A Firebase [Promise](https://firebase.google.com/docs/reference/js/firebase.Promise) + * which resolves when the write is complete and rejects if there is an + * error. + */ + remove( + endpoint: string, + callback?: (result: Promise) => void + ): Promise; + + /** + * Bind a document to your component. When then document changes in + * firestore, your component will re-render with the latest data. + * @param refOrPath DocumentReference or path. + * @param options bindDoc Options. + * @returns An object which you can pass to `removeBinding` if you want + * to remove the listener while the component is still mounted. + */ + bindDoc(refOrPath: object | string, options: bindDocOptions): object; + + /** + * Listen to a document, when the data changes it will invoke a + * callback passing it the new data from Firestore. + * @param refOrPath DocumentReference or path. + * @param options listenToDoc Options. + * @returns An object which you can pass to `removeBinding` if you want + * to remove the listener while the component is still mounted. + */ + listenToDoc( + refOrPath: object | string, + options: listenToDocOptions + ): object; + + /** + * Bind a collection to a state property in your component. When then + * collection changes in firestore, your component will re-render with + * the latest data. + * @param refOrPath CollectionReference or path. + * @param options bindCollection Options. + * @returns An object which you can pass to `removeBinding` if you want + * to remove the listener while the component is still mounted. + */ + bindCollection( + refOrPath: object | string, + options: bindCollectionOptions + ): RebaseBinding; + + /** + * Listen to a collection, when the data changes it will invoke a + * callback passing it the new data from Firestore. + * @param refOrPath CollectionReference or path. + * @param options listenToCollection Options. + * @returns An object which you can pass to `removeBinding` if you want + * to remove the listener while the component is still mounted. + */ + listenToCollection( + refOrPath: object | string, + options: listenToCollectionOptions + ): RebaseBinding; + + /** + * Fetch either a Collection or Document. + * @param refOrPath CollectionReference, DocumentReference or path. + * @param options get Options. + * @returns A Promise thats resolve with the resulting data or rejects + * if the document/collection does not exist or there are any read + * errors. + */ + get( + refOrPath: object | object | string, + options: listenToCollectionOptions + ): Promise; + + /** + * Add a new Document to a Collection. + * @param refOrPath CollectionReference or path. + * @param data The document data. + * @param id The id for the document. If omitted, the Firestore will + * generate an id for you. + * @returns A Promise thats resolve with the resulting data or rejects + * if the document/collection does not exist or there are any read + * errors. + */ + addToCollection( + refOrPath: object | string, + data: object, + id?: string + ): Promise; + + /** + * Update an existing document. + * @param refOrPath DocumentReference or path. + * @param data The document data. + * @returns A Promise thats resolve with the resulting data or rejects + * if the document/collection does not exist or there are any read + * errors. + */ + updateDoc(refOrPath: object | string, data: object): Promise; + + /** + * Deletes a document. + * @param refOrPath DocumentReference or path. + * @param data The document data. + * @returns A Promise thats resolve with the resulting data or rejects + * if the document/collection does not exist or there are any read + * errors. + */ + removeDoc(refOrPath: object | string, data: object): Promise; + + /** + * Removes documents from a collection. If no query is supplied, it + * will remove all the documents. If a query is supplied, it will only + * remove documents that match the query. + * @param refOrPath CollectionReference or path. + * @param options removeFromCollection Options. + * @returns A Promise thats resolve with the resulting data or rejects + * if the document/collection does not exist or there are any read + * errors. + */ + removeFromCollection( + refOrPath: object | string, + options: removeFromCollectionOptions + ): Promise; + + /** + * Syncs a component's local state with a document in Firestore. + * @param refOrPath DocumentReference or path. + * @param options removeFromCollection Options. + * @returns A Promise thats resolve with the resulting data or rejects + * if the document/collection does not exist or there are any read + * errors. + */ + syncDoc(refOrPath: object | string, options: syncDocOptions): object; + + /** + * Clean up a listener. Listeners are automatically cleaned up when + * components unmount, however if you wish to remove a listener while + * the component is still mounted this will allow you to do that. An + * example would be if you want to start listening to a new document or + * change a query on all collection in response to a prop change. + * @param ref The return value of syncState`, `bindToState`, `listenTo`, + * `listenToCollection`, `bindCollection`, `listenToDoc`, `bindDoc` or + * `syncDoc`. + */ + removeBinding(ref: object): void; + + /** + * Removes every Firebase/Firestore listener. + */ + reset(): void; +} + +/** + * Accepts an initialized firebase/firestore database object. + * @param database Initialized firebase/firestore + * database. + * @return An instance of re-base. + */ +export function createClass(database: object): Rebase; diff --git a/types/re-base/re-base-tests.ts b/types/re-base/re-base-tests.ts new file mode 100644 index 0000000000..0edc9ea542 --- /dev/null +++ b/types/re-base/re-base-tests.ts @@ -0,0 +1,10 @@ +import * as rebase from "re-base"; + +const database = {}; +const base = rebase.createClass(database); +const bar = {}; + +const _ref = base.syncState("foo", { + context: bar, + state: "foo" +}); diff --git a/types/re-base/tsconfig.json b/types/re-base/tsconfig.json new file mode 100644 index 0000000000..ff88a407d4 --- /dev/null +++ b/types/re-base/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "re-base-tests.ts"] +} diff --git a/types/re-base/tslint.json b/types/re-base/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/re-base/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-calendar-timeline/index.d.ts b/types/react-calendar-timeline/index.d.ts index 69e5d037dc..2ff17f6a82 100644 --- a/types/react-calendar-timeline/index.d.ts +++ b/types/react-calendar-timeline/index.d.ts @@ -1,71 +1,131 @@ -// Type definitions for react-calendar-timeline v0.8.1 +// Type definitions for react-calendar-timeline v0.16.3 // Project: https://github.com/namespace-ee/react-calendar-timeline // Definitions by: Rajab Shakirov +// Alex Maclean // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 /// declare module "react-calendar-timeline" { - interface ReactCalendarTimeline { - groups: { - id: number; - title: any; // string | Element (React.ClassicComponentClass); - }[]; - items:{ - id: number; - group: number; - title?: any; // string | Element (React.ClassicComponentClass); - start_time: any; - end_time: any; - canMove?: boolean; - canResize?: boolean; - canChangeGroup?: boolean; - className?: string; - }[]; - keys?:{ - groupIdKey: string; - groupTitleKey: string; - itemIdKey: string; - itemTitleKey: string; - itemGroupKey: string; - itemTimeStartKey: string; - itemTimeEndKey: string; - }; - sidebarWidth?: number; - dragSnap?: number; - minResizeWidth?: number; - fixedHeader?: "fixed" | "none"; - zIndexStart?: number; - lineHeight?: number; - headerLabelGroupHeight?: number; - headerLabelHeight?: number; - itemHeightRatio?: number; - minZoom?: number; - maxZoom?: number; - canMove?: boolean; - canChangeGroup?: boolean; - canResize?: boolean; - useResizeHandle?: boolean; - stackItems?: boolean; - traditionalZoom?: boolean; - itemTouchSendsClick?: boolean; - onItemMove?(itemId:any, dragTime:any, newGroupOrder:any): any; - onItemResize?(itemId:any, newResizeEnd:any): any; - onItemSelect?(itemId:any): any; - onItemClick?(itemId:any): any; - onCanvasClick?(groupId:any, time:any, e:any): any; - onItemDoubleClick?(itemId:any): any; - moveResizeValidator?(action:any, itemId:any, time:any): any; - defaultTimeStart?: any; - defaultTimeEnd?: any; - visibleTimeStart?: number; - visibleTimeEnd?: number; - onTimeChange?(visibleTimeStart:any, visibleTimeEnd:any): any; - onTimeInit?(visibleTimeStart:any, visibleTimeEnd:any): any; - onBoundsChange?(canvasTimeStart:any, canvasTimeEnd:any): any; - children?: any; - } - let ReactCalendarTimeline : React.ClassicComponentClass; - export default ReactCalendarTimeline; + + export interface TimelineGroup { + id: number; + title: React.ReactNode; + rightTitle?: React.ReactNode; + } + + export interface TimelineItem { + id: number; + group: number; + title?: React.ReactNode; + start_time: any; + end_time: any; + canMove?: boolean; + canResize?: boolean | "left" | "right" | "both"; + canChangeGroup?: boolean; + className?: string; + itemProps?: {}; + } + + export interface TimelineContext { + visibletimeStart: number, + visibleTimeEnd: number, + timelineWidth: number + } + + export interface TimelineTimeSteps { + second: number, + minute: number, + hour: number, + day: number, + month: number, + year: number + } + + export interface TimelineHeaderLabelFormat { + yearShort: string, + yearLong: string, + monthShort: string, + monthMedium: string, + monthMediumLong: string, + monthLong: string, + dayShort: string, + dayLong: string, + hourShort: string, + hourMedium: string, + hourMediumLong: string, + hourLong: string, + time: string + } + + export interface ReactCalendarTimelineProps { + groups: TimelineGroup[]; + items: TimelineItem[]; + keys?:{ + groupIdKey: string; + groupTitleKey: string; + itemIdKey: string; + itemTitleKey: string; + itemGroupKey: string; + itemTimeStartKey: string; + itemTimeEndKey: string; + }; + defaultTimeStart?: any; + defaultTimeEnd?: any; + visibleTimeStart?: any; + visibleTimeEnd?: any; + selected?: number[]; + sidebarWidth?: number; + sidebarContent?: React.ReactNode; + rightSidebarWidth?: number; + rightSidebarContent?: React.ReactNode; + dragSnap?: number; + minResizeWidth?: number; + stickyOffset?: number; + stickyHeader?: boolean; + headerRef?: any; + lineHeight?: number; + headerLabelGroupHeight?: number; + headerLabelHeight?: number; + itemHeightRatio?: number; + minZoom?: number; + maxZoom?: number; + clickTolerance?: number; + canMove?: boolean; + canChangeGroup?: boolean; + canResize?: boolean | "left" | "right" | "both"; + useResizeHandle?: boolean; + showCursorLine?: boolean; + stackItems?: boolean; + traditionalZoom?: boolean; + itemTouchSendsClick?: boolean; + timeSteps?: TimelineTimeSteps, + onItemMove?(itemId: number, dragTime: number, newGroupOrder: number): any; + onItemResize?(itemId: number, newResizeEnd: number, edge: "left" | "right"): any; + onItemSelect?(itemId: number, e: any, time: number): any; + onItemClick?(itemId: number, e: any, time: number): any; + onItemDoubleClick?(itemId: number, e: any, time: number): any; + onCanvasClick?(groupId:number, time:number, e:any): any; + onCanvasDoubleClick?(group: TimelineGroup, time: number, e: any): any; + onCanvasContextMenu?(group: TimelineGroup, time: number, e: any): any; + onZoom?(timelineContext: TimelineContext): any; + moveResizeValidator?(action:"move" | "resize", itemId: number, time: number, resizeEdge: "left" | "right"): any; + headerLabelFormats?: TimelineHeaderLabelFormat, + subHeaderLabelFormats?: TimelineHeaderLabelFormat, + onTimeChange?(visibleTimeStart: number, visibleTimeEnd: number, updateScrollCanvas: (start: number, end: number) => void): any; + onTimeInit?(canvasTimeStart: number, canvasTimeEnd: number): any; + onBoundsChange?(canvasTimeStart: number, canvasTimeEnd: number): any; + itemRenderer?: (props: {item: TimelineItem, context: TimelineContext}) => React.ReactElement<{}>; + groupRenderer?: (props: {group: TimelineGroup, isRightSidebar: boolean}) => React.ReactElement<{}>; + minimumWidthForItemContentVisibility?: number; + children?: any; + } + + export const defaultHeaderLabelFormats: TimelineHeaderLabelFormat; + export const defaultSubHeaderLabelFormats: TimelineHeaderLabelFormat; + + let ReactCalendarTimeline : React.ClassicComponentClass; + export default ReactCalendarTimeline; + } diff --git a/types/react-native-auth0/index.d.ts b/types/react-native-auth0/index.d.ts index 1291baeafd..b6a4e769e8 100644 --- a/types/react-native-auth0/index.d.ts +++ b/types/react-native-auth0/index.d.ts @@ -137,6 +137,7 @@ export interface AuthorizeParams { nonce?: string; audience?: string; scope?: string; + connection?: string; } export interface ClearSessionParams { diff --git a/types/react-native-datepicker/index.d.ts b/types/react-native-datepicker/index.d.ts index ceb0e612aa..dfc8bd5b13 100644 --- a/types/react-native-datepicker/index.d.ts +++ b/types/react-native-datepicker/index.d.ts @@ -30,6 +30,7 @@ export interface DatePickerProps { placeholder?: string; modalOnResponderTerminationRequest?(e: any): boolean; is24Hour?: boolean; + getDateStr?: (date: Date) => string; style?: any; customStyles?: any; minuteInterval?: number; diff --git a/types/react-native-material-textfield/index.d.ts b/types/react-native-material-textfield/index.d.ts index 9b6c2941af..5f3ffc437f 100644 --- a/types/react-native-material-textfield/index.d.ts +++ b/types/react-native-material-textfield/index.d.ts @@ -1,11 +1,18 @@ // Type definitions for react-native-material-textfield 0.12 // Project: https://github.com/n4kz/react-native-material-textfield // Definitions by: Ville Venäläinen +// Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.6 import * as React from 'react'; -import { TextInputProps, TextStyle, ViewStyle, View } from 'react-native'; +import { + StyleProp, + TextInputProps, + TextStyle, + ViewStyle, + View +} from 'react-native'; export interface TextFieldProps extends TextInputProps { animationDuration?: number; @@ -17,9 +24,10 @@ export interface TextFieldProps extends TextInputProps { labelPadding?: number; inputContainerPadding?: number; - labelTextStyle?: TextStyle; - titleTextStyle?: TextStyle; - affixTextStyle?: TextStyle; + style?: StyleProp; + labelTextStyle?: StyleProp; + titleTextStyle?: StyleProp; + affixTextStyle?: StyleProp; tintColor?: string; textColor?: string; @@ -47,8 +55,8 @@ export interface TextFieldProps extends TextInputProps { prefix?: string; suffix?: string; - containerStyle?: ViewStyle; - inputContainerStyle?: ViewStyle; + containerStyle?: StyleProp; + inputContainerStyle?: StyleProp; onPress?(event: Event): void; onChangeText?(text: string): void; diff --git a/types/react-native-material-textfield/react-native-material-textfield-tests.tsx b/types/react-native-material-textfield/react-native-material-textfield-tests.tsx index 08b33e31d0..50fb2b166b 100644 --- a/types/react-native-material-textfield/react-native-material-textfield-tests.tsx +++ b/types/react-native-material-textfield/react-native-material-textfield-tests.tsx @@ -1,13 +1,15 @@ import * as React from 'react'; -import { View, Text } from 'react-native'; +import { View } from 'react-native'; import { TextField } from 'react-native-material-textfield'; -const Example = () => +const Example = () => ( - ; + +); diff --git a/types/react-native-snap-carousel/index.d.ts b/types/react-native-snap-carousel/index.d.ts index 5b5406f6fa..56b083638b 100644 --- a/types/react-native-snap-carousel/index.d.ts +++ b/types/react-native-snap-carousel/index.d.ts @@ -45,6 +45,10 @@ export interface CarouselProps extends React.Props { * Width in pixels of your slides, must be the same for all of them * Note: Required with horizontal carousel */ + /** + * Reverses the direction of scroll. Uses scale transforms of -1. + */ + inverted?: boolean; itemWidth?: number; /** * Height in pixels of carousel's items, must be the same for all of them diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index ef574ec807..eaa2dcccfc 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1078,6 +1078,12 @@ export type ReturnKeyTypeAndroid = "none" | "previous"; export type ReturnKeyTypeIOS = "default" | "google" | "join" | "route" | "yahoo" | "emergency-call"; export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS +export interface TextInputFocusEventData { + target: number, + text: string, + eventCount: number +} + /** * @see https://facebook.github.io/react-native/docs/textinput.html#props */ @@ -1159,7 +1165,7 @@ export interface TextInputProps /** * Callback that is called when the text input is blurred */ - onBlur?: () => void; + onBlur?: (e: NativeSyntheticEvent) => void; /** * Callback that is called when the text input's text changes. @@ -1198,7 +1204,7 @@ export interface TextInputProps /** * Callback that is called when the text input is focused */ - onFocus?: () => void; + onFocus?: (e: NativeSyntheticEvent) => void; /** * Callback that is called when the text input selection is changed. diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index b3487057ed..1f506eb124 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -49,8 +49,10 @@ import { NativeModules, MaskedViewIOS, TextInput, + TextInputFocusEventData, InputAccessoryView, - StatusBar + StatusBar, + NativeSyntheticEvent } from "react-native"; declare module "react-native" { @@ -447,6 +449,25 @@ class TextInputRefTest extends React.Component<{}, {username: string}> { } } +class TextInputFocusBlurEventTest extends React.Component { + handleOnBlur(e: NativeSyntheticEvent) { + } + + handleOnFocus(e: NativeSyntheticEvent) { + } + + render() { + return ( + + ) => this.handleOnBlur(e)} + onFocus={(e: NativeSyntheticEvent) => this.handleOnFocus(e)} + /> + + ) + } +} + class StatusBarTest extends React.Component { render() { StatusBar.setBarStyle("dark-content", true); diff --git a/types/restify-errors/index.d.ts b/types/restify-errors/index.d.ts index ecec86f8f7..fb9c136ab1 100644 --- a/types/restify-errors/index.d.ts +++ b/types/restify-errors/index.d.ts @@ -130,6 +130,11 @@ export class InsufficientStorageError extends DefinedHttpError { } export class BandwidthLimitExceededError extends DefinedHttpError { } export class NotExtendedError extends DefinedHttpError { } export class NetworkAuthenticationRequiredError extends DefinedHttpError { } +export class PayloadTooLargeError extends DefinedHttpError { } +export class UriTooLongError extends DefinedHttpError { } +export class MisdirectedRequestError extends DefinedHttpError { } +export class UnavailableForLegalReasonsError extends DefinedHttpError { } +export class LoopDetectedError extends DefinedHttpError { } export class BadDigestError extends DefinedRestError { } export class BadMethodError extends DefinedRestError { } diff --git a/types/restify-errors/restify-errors-tests.ts b/types/restify-errors/restify-errors-tests.ts index 600a0545fb..2bda424f6a 100644 --- a/types/restify-errors/restify-errors-tests.ts +++ b/types/restify-errors/restify-errors-tests.ts @@ -62,6 +62,12 @@ httpError = new restifyErrors.InsufficientStorageError(); httpError = new restifyErrors.BandwidthLimitExceededError(); httpError = new restifyErrors.NotExtendedError(); httpError = new restifyErrors.NetworkAuthenticationRequiredError(); +httpError = new restifyErrors.PayloadTooLargeError(); +httpError = new restifyErrors.UriTooLongError(); +httpError = new restifyErrors.MisdirectedRequestError(); +httpError = new restifyErrors.UnavailableForLegalReasonsError(); +httpError = new restifyErrors.LoopDetectedError(); +httpError = new restifyErrors.NetworkAuthenticationRequiredError(); // RestErrors let restError = new restifyErrors.BadDigestError(); diff --git a/types/rolling-rate-limiter/index.d.ts b/types/rolling-rate-limiter/index.d.ts new file mode 100644 index 0000000000..c81c8304d7 --- /dev/null +++ b/types/rolling-rate-limiter/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for rolling-rate-limiter 0.1 +// Project: https://github.com/peterkhayes/rolling-rate-limiter +// Definitions by: Jonas Lochmann +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = RollingRateLimiter; + +declare function RollingRateLimiter(options: RollingRateLimiter.InMemoryOptions): RollingRateLimiter.SyncOrAsyncLimiter; +declare function RollingRateLimiter(options: RollingRateLimiter.WithRedisOptions): RollingRateLimiter.AsyncLimiter; + +declare namespace RollingRateLimiter { + interface GeneralOptions { + interval: number; + maxInInterval: number; + minDifference?: number; + } + + interface WithRedisOptions extends GeneralOptions { + redis: CompatibleRedisClient; + namespace?: string; + } + + interface CompatibleRedisClient { + multi: () => any; + } + + type InMemoryOptions = GeneralOptions; + + type AsyncLimiterWithToken = (token: string, callback: AsyncLimiterCallback) => void; + type AsyncLimiterWithoutToken = (callback: AsyncLimiterCallback) => void; + type AsyncLimiterCallback = (err: any, timeLeft: number, actionsLeft: number) => void; + type AsyncLimiter = AsyncLimiterWithToken & AsyncLimiterWithToken; + + type SyncLimiter = (token?: string) => number; + + type SyncOrAsyncLimiter = SyncLimiter & AsyncLimiter; +} diff --git a/types/rolling-rate-limiter/rolling-rate-limiter-tests.ts b/types/rolling-rate-limiter/rolling-rate-limiter-tests.ts new file mode 100644 index 0000000000..1318b8d425 --- /dev/null +++ b/types/rolling-rate-limiter/rolling-rate-limiter-tests.ts @@ -0,0 +1,36 @@ +import * as RateLimiter from 'rolling-rate-limiter'; + +/* + Setup: +*/ + +const limiter = RateLimiter({ + // in miliseconds + interval: 1000, + maxInInterval: 10, + // optional: the minimum time (in miliseconds) between any two actions + minDifference: 100 +}); + +/* + Action: +*/ + +function attemptAction(userId: string) { + // Argument should be a unique identifier for a user if one exists. + // If none is provided, the limiter will not differentiate between users. + const timeLeft = limiter(userId); + + if (timeLeft > 0) { + // limit was exceeded, action should not be allowed + // timeLeft is the number of ms until the next action will be allowed + // note that this can be treated as a boolean, since 0 is falsy + } else { + // limit was not exceeded, action should be allowed + } +} + +/* + Note that the in-memory version can also operate asynchronously. + The syntax is identical to the redis implementation below. +*/ diff --git a/types/rolling-rate-limiter/tsconfig.json b/types/rolling-rate-limiter/tsconfig.json new file mode 100644 index 0000000000..0b526f946e --- /dev/null +++ b/types/rolling-rate-limiter/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "rolling-rate-limiter-tests.ts" + ] +} diff --git a/types/rolling-rate-limiter/tslint.json b/types/rolling-rate-limiter/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/rolling-rate-limiter/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index cf7a1e3c02..9cf60439c8 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -8,6 +8,7 @@ // Kyle Kamperschroer // Kensuke Hoshikawa // Thomas Bruun +// Gal Talmor // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -481,7 +482,7 @@ declare namespace Stripe { /** * ID of the Connect Application that earned the fee. [Expandable] */ - application: string; //TODO: Implement IApplication interface and reference type here for expansion:- "string | IApplication" + application: string | applications.IApplication; /** * Balance transaction that describes the impact of this collected application @@ -737,12 +738,17 @@ declare namespace Stripe { * charge if a partial refund was issued), positive integer or zero. */ amount_refunded: number; + + /** + * ID of the Connect application that created the charge. [Expandable] + */ + application?: string | applications.IApplication | null; /** * The application fee (if any) for the charge. See the Connect documentation * for details. [Expandable] */ - application_fee?: string | applicationFees.IApplicationFee; + application_fee?: string | applicationFees.IApplicationFee | null; /** * ID of the balance transaction that describes the impact of this charge on @@ -767,25 +773,33 @@ declare namespace Stripe { /** * ID of the customer this charge is for if one exists. [Expandable] */ - customer: string | customers.ICustomer; + customer: string | customers.ICustomer | null; description?: string; + /** + * The account (if any) the charge was made on behalf of, with an automatic + * transfer. See the [Connect documentation] + * for details. + * [Expandable] + */ + destination?: string | accounts.IAccount | null; + /** * Details about the dispute if the charge has been disputed. */ - dispute?: disputes.IDispute; + dispute?: disputes.IDispute | null; /** * Error code explaining reason for charge failure if available (see the errors section for a list of * codes: https://stripe.com/docs/api#errors). */ - failure_code: string; + failure_code: string | null; /** * Message to user further explaining reason for charge failure if available. */ - failure_message: string; + failure_message: string | null; /** * Hash with information on fraud assessments for the charge. @@ -805,16 +819,30 @@ declare namespace Stripe { /** * ID of the invoice this charge is for if one exists. [Expandable] */ - invoice: string | invoices.IInvoice; + invoice: string | invoices.IInvoice | null; livemode: boolean; metadata: IMetadata; + /** + * The Stripe account ID for which these funds are intended. Automatically + * set if you use the destination parameter. For details, see [Creating + * Separate Charges and Transfers] + * . + */ + on_behalf_of?: string | null; + /** * ID of the order this charge is for if one exists. [Expandable] */ - order: string | orders.IOrder; + order: string | orders.IOrder | null; + + /** + * Details about whether the payment was accepted, and why. See + * understanding declines for details. [Expandable] + */ + outcome?: charges.IOutcome; /** * true if the charge succeeded, or was successfully authorized for later capture. @@ -824,12 +852,12 @@ declare namespace Stripe { /** * This is the email address that the receipt for this charge was sent to. */ - receipt_email: string; + receipt_email: string | null; /** * This is the transaction number that appears on email receipts sent for this charge. */ - receipt_number: string; + receipt_number: string | null; /** * Whether or not the charge has been fully refunded. If the charge is only partially refunded, @@ -842,10 +870,15 @@ declare namespace Stripe { */ refunds: IChargeRefunds; + /** + * ID of the review associated with this charge if one exists. [Expandable] + */ + review?: string | reviews.IReview | null; + /** * Shipping information for the charge. */ - shipping?: IShippingInformation; + shipping?: IShippingInformation | null; /** * For most Stripe users, the source of every charge is a credit or debit card. @@ -858,13 +891,13 @@ declare namespace Stripe { * from another Stripe account. See the Connect documentation for details. * [Expandable] */ - source_transfer: string | transfers.ITransfer; + source_transfer: string | transfers.ITransfer | null; /** * Extra information about a charge. This will appear on your customer’s * credit card statement. */ - statement_descriptor: string; + statement_descriptor: string | null; /** * The status of the payment is either "succeeded", "pending", or "failed". @@ -875,7 +908,15 @@ declare namespace Stripe { * ID of the transfer to the destination account (only applicable if the * charge was created using the destination parameter). [Expandable] */ - transfer: string | transfers.ITransfer; + transfer?: string | transfers.ITransfer; + + /** + * A string that identifies this transaction as part of a group. + * See the [Connect documentation] + * + * for details. + */ + transfer_group?: string | null; } interface IChargeCreationOptions extends IDataOptionsWithMetadata { @@ -1056,6 +1097,48 @@ declare namespace Stripe { } } + interface IOutcome { + /** + * The value reversed_after_approval indicates the payment was blocked by Stripe after + * bank authorization, and may temporarily appear as “pending” on a cardholder’s statement. + */ + network_status: "approved_by_network" | "declined_by_network" | "not_sent_to_network" | "reversed_after_approval"; + + /** + * An enumerated value providing a more detailed explanation of the outcome’s type. Charges + * blocked by Radar’s default block rule have the value highest_risk_level. Charges placed + * in review by Radar’s default review rule have the value elevated_risk_level. Charges + * authorized, blocked, or placed in review by custom rules have the value rule. See + * understanding declines for more details. + */ + reason: string | null; + + /** + * Stripe’s evaluation of the riskiness of the payment. Possible values for evaluated + * payments are normal, elevated, highest. For non-card payments, and card-based payments + * predating the public assignment of risk levels, this field will have the value not_assessed. + * In the event of an error in the evaluation, this field will have the value unknown. + */ + risk_level?: string | null; + + /** + * The ID of the Radar rule that matched the payment, if applicable. [Expandable] + */ + rule?: string | string[] | null; + + /** + * See [understanding declines] and + * [Radar reviews] for details. + */ + type: "authorized" | "manual_review" | "issuer_declined" | "blocked" | "invalid"; + + /** + * A human-readable description of the outcome type and reason, designed for you (the + * recipient of the payment), not your customer. + */ + seller_message: string; + } + interface IChargeRefunds extends IList, resources.ChargeRefunds { } } @@ -4092,7 +4175,7 @@ declare namespace Stripe { * in the card object if the card belongs to an account or recipient * instead. */ - customer?: string | customers.ICustomer; + customer?: string | customers.ICustomer | null; /** * Only applicable on accounts (not customers or recipients). This @@ -4126,7 +4209,7 @@ declare namespace Stripe { /** * The card number */ - number: string; + number?: string; /** * Card brand. Can be Visa, American Express, MasterCard, Discover, JCB, Diners Club, or Unknown. @@ -4140,20 +4223,20 @@ declare namespace Stripe { */ funding: "credit" | "debit" | "prepaid" | "unknown"; last4: string; - address_city: string; + address_city: string | null; /** * Billing address country, if provided when creating card */ - address_country: string; - address_line1: string; + address_country: string | null; + address_line1: string | null; /** * If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked. */ - address_line1_check: string; - address_line2: string; - address_state: string; + address_line1_check: string | null; + address_line2: string | null; + address_state: string | null; address_zip: string; /** @@ -4175,7 +4258,7 @@ declare namespace Stripe { /** * (For Apple Pay integrations only.) The last four digits of the device account number. */ - dynamic_last4: string; + dynamic_last4: string | null; /** * Cardholder name @@ -4194,7 +4277,7 @@ declare namespace Stripe { * If the card number is tokenized, this is the method that was * used. Can be "apple_pay" or "android_pay". */ - tokenization_method: "apple_pay" | "android_pay"; + tokenization_method: "apple_pay" | "android_pay" | null; } interface ICardUpdateOptions extends IDataOptionsWithMetadata { @@ -4944,6 +5027,54 @@ declare namespace Stripe { } } + namespace reviews { + interface IReview extends IResourceObject { + /** + * String representing the object’s type. Objects of the same type share the same value. + */ + object: "review"; + + /** + * The charge associated with this review. [Expandable] + */ + charge: string | charges.ICharge; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Has the value true if the object exists in live mode or the value false if the object exists in test mode. + */ + livemode: boolean; + + /** + * If true, the review needs action. + */ + open: boolean; + + /** + * The reason the review is currently open or closed. + */ + reason: "rule" | "manual" | "approved" | "refunded" | "refunded_as_fraud" | "disputed"; + } + } + + namespace applications { + interface IApplication extends IResourceObject { + /** + * String representing the object’s type. Objects of the same type share the same value. + */ + object: "application"; + + /** + * String representing the application’s name. + */ + name: string; + } + } + class StripeResource { constructor(stripe: Stripe, urlData: any); } @@ -5388,18 +5519,18 @@ declare namespace Stripe { * Once entirely refunded, a charge can't be refunded again. * This method will throw an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge. */ - create(data: refunds.IRefundCreationOptions, options: HeaderOptions, response?: IResponseFn): Promise; - create(data: refunds.IRefundCreationOptions, response?: IResponseFn): Promise; - create(options: HeaderOptions, response?: IResponseFn): Promise; - create(response?: IResponseFn): Promise; + create?(data: refunds.IRefundCreationOptions, options: HeaderOptions, response?: IResponseFn): Promise; + create?(data: refunds.IRefundCreationOptions, response?: IResponseFn): Promise; + create?(options: HeaderOptions, response?: IResponseFn): Promise; + create?(response?: IResponseFn): Promise; /** * Retrieves the details of an existing refund. */ - retrieve(id: string, data: IDataOptions, options: HeaderOptions, response?: IResponseFn): Promise; - retrieve(id: string, data: IDataOptions, response?: IResponseFn): Promise; - retrieve(id: string, options: HeaderOptions, response?: IResponseFn): Promise; - retrieve(id: string, response?: IResponseFn): Promise; + retrieve?(id: string, data: IDataOptions, options: HeaderOptions, response?: IResponseFn): Promise; + retrieve?(id: string, data: IDataOptions, response?: IResponseFn): Promise; + retrieve?(id: string, options: HeaderOptions, response?: IResponseFn): Promise; + retrieve?(id: string, response?: IResponseFn): Promise; /** @@ -5408,18 +5539,18 @@ declare namespace Stripe { * * This request only accepts metadata as an argument. */ - update(id: string, data: IDataOptionsWithMetadata, options: HeaderOptions, response?: IResponseFn): Promise; - update(id: string, data: IDataOptionsWithMetadata, response?: IResponseFn): Promise; + update?(id: string, data: IDataOptionsWithMetadata, options: HeaderOptions, response?: IResponseFn): Promise; + update?(id: string, data: IDataOptionsWithMetadata, response?: IResponseFn): Promise; /** * Returns a list of all refunds you’ve previously created. The refunds are returned in sorted order, * with the most recent refunds appearing first. * For convenience, the 10 most recent refunds are always available by default on the charge object. */ - list(data: refunds.IRefundListOptions, options: HeaderOptions, response?: IResponseFn>): Promise>; - list(data: refunds.IRefundListOptions, response?: IResponseFn>): Promise>; - list(options: HeaderOptions, response?: IResponseFn>): Promise>; - list(response?: IResponseFn>): Promise>; + list?(data: refunds.IRefundListOptions, options: HeaderOptions, response?: IResponseFn>): Promise>; + list?(data: refunds.IRefundListOptions, response?: IResponseFn>): Promise>; + list?(options: HeaderOptions, response?: IResponseFn>): Promise>; + list?(response?: IResponseFn>): Promise>; } class Coupons extends StripeResource {