declare var __registerDomainDispatcher; declare var __inspectorSendEvent; export function DomainDispatcher(domain: string): ClassDecorator { return klass => __registerDomainDispatcher(domain, klass); } // ApplicationCache export namespace ApplicationCacheDomain { export interface ApplicationCacheResource { // Resource url. url: string; // Resource size. size: number; // Resource type. type: string; } export interface ApplicationCache { // Manifest URL. manifestURL: string; // Application cache size. size: number; // Application cache creation time. creationTime: number; // Application cache update time. updateTime: number; // Application cache resources. resources: ApplicationCacheResource[]; } export interface FrameWithManifest { // Frame identifier. frameId: NetworkDomain.FrameId; // Manifest URL. manifestURL: string; // Application cache status. status: number; } export interface GetManifestForFrameMethodArguments { // Identifier of the frame containing document whose manifest is retrieved. frameId: NetworkDomain.FrameId } export interface GetApplicationCacheForFrameMethodArguments { // Identifier of the frame containing document whose application cache is retrieved. frameId: NetworkDomain.FrameId } export interface ApplicationCacheDomainDispatcher { // Returns array of frame identifiers with manifest urls for each frame containing a document associated with some application cache. getFramesWithManifests(): { frameIds: FrameWithManifest[] }; // Enables application cache domain notifications. enable(): void; // Returns manifest URL for document in the given frame. getManifestForFrame(params: GetManifestForFrameMethodArguments): { manifestURL: string }; // Returns relevant application cache data for the document in given frame. getApplicationCacheForFrame(params: GetApplicationCacheForFrameMethodArguments): { applicationCache: ApplicationCache }; } export class ApplicationCacheFrontend { applicationCacheStatusUpdated(frameId: NetworkDomain.FrameId, manifestURL: string, status: number): void { __inspectorSendEvent(JSON.stringify( { "method": "ApplicationCache.applicationCacheStatusUpdated", "params": { "frameId": frameId, "manifestURL": manifestURL, "status": status } } )); } networkStateUpdated(isNowOnline: boolean): void { __inspectorSendEvent(JSON.stringify( { "method": "ApplicationCache.networkStateUpdated", "params": { "isNowOnline": isNowOnline } } )); } } } // CSS // This domain exposes CSS read/write operations. All CSS objects, like stylesheets, rules, and styles, have an associated id used in subsequent operations on the related object. Each object type has a specific id structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode() calls (which accept a DOM node id). Alternatively, a client can discover all the existing stylesheets with the getAllStyleSheets() method and subsequently load the required stylesheet contents using the getStyleSheet[Text]() methods. export namespace CSSDomain { export type StyleSheetId = string export interface CSSStyleId { // Enclosing stylesheet identifier. styleSheetId: StyleSheetId; // The style ordinal within the stylesheet. ordinal: number; } export interface CSSRuleId { // Enclosing stylesheet identifier. styleSheetId: StyleSheetId; // The rule ordinal within the stylesheet. ordinal: number; } export interface PseudoIdMatches { // Pseudo style identifier (see enum PseudoId in RenderStyleConstants.h). pseudoId: number; // Matches of CSS rules applicable to the pseudo style. matches: RuleMatch[]; } export interface InheritedStyleEntry { // The ancestor node's inline style, if any, in the style inheritance chain. inlineStyle?: CSSStyle; // Matches of CSS rules matching the ancestor node in the style inheritance chain. matchedCSSRules: RuleMatch[]; } export interface RuleMatch { // CSS rule in the match. rule: CSSRule; // Matching selector indices in the rule's selectorList selectors (0-based). matchingSelectors: number[]; } export interface CSSSelector { // Canonicalized selector text. text: string; // Specificity (a, b, c) tuple. Included if the selector is sent in response to CSS.getMatchedStylesForNode which provides a context element. specificity?: number[]; // Whether or not the specificity can be dynamic. Included if the selector is sent in response to CSS.getMatchedStylesForNode which provides a context element. dynamic?: boolean; } export interface SelectorList { // Selectors in the list. selectors: CSSSelector[]; // Rule selector text. text: string; // Rule selector range in the underlying resource (if available). range?: SourceRange; } export interface CSSStyleAttribute { // DOM attribute name (e.g. "width"). name: string; // CSS style generated by the respective DOM attribute. style: CSSStyle; } export interface CSSStyleSheetHeader { // The stylesheet identifier. styleSheetId: StyleSheetId; // Owner frame identifier. frameId: NetworkDomain.FrameId; // Stylesheet resource URL. sourceURL: string; // Stylesheet origin. origin: StyleSheetOrigin; // Stylesheet title. title: string; // Denotes whether the stylesheet is disabled. disabled: boolean; // Whether this stylesheet is a