diff --git a/tns-core-modules/debugger/InspectorBackendCommands.ios.ts b/tns-core-modules/debugger/InspectorBackendCommands.ios.ts index 471e80dd0..677c34393 100644 --- a/tns-core-modules/debugger/InspectorBackendCommands.ios.ts +++ b/tns-core-modules/debugger/InspectorBackendCommands.ios.ts @@ -1,4 +1,5 @@ declare var __registerDomainDispatcher; +declare var __inspectorSendEvent; export function DomainDispatcher(domain: string): ClassDecorator { return klass => __registerDomainDispatcher(domain, klass); } @@ -6,63 +7,61 @@ export function DomainDispatcher(domain: string): ClassDecorator { export namespace ApplicationCacheDomain { export interface ApplicationCacheResource { - // Resource url. - url: string; - // Resource size. - size: number; - // Resource type. - type: string; + // 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[]; + // 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; + // 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 + // 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 + // 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 }; + // 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 { - constructor(private dispatchMessage: (message: String) => void) { - } - applicationCacheStatusUpdated(frameId: NetworkDomain.FrameId, manifestURL: string, status: number): void { - this.dispatchMessage(JSON.stringify( { "method": "ApplicationCache.applicationCacheStatusUpdated", "params": { "frameId": frameId, "manifestURL": manifestURL, "status": status } } )); - } - networkStateUpdated(isNowOnline: boolean): void { - this.dispatchMessage(JSON.stringify( { "method": "ApplicationCache.networkStateUpdated", "params": { "isNowOnline": isNowOnline } } )); - } + 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 } } )); + } } } @@ -72,205 +71,211 @@ export namespace CSSDomain { export type StyleSheetId = string export interface CSSStyleId { - // Enclosing stylesheet identifier. - styleSheetId: StyleSheetId; - // The style ordinal within the stylesheet. - ordinal: number; + // 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; + // 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[]; + // 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[]; + // 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[]; + // 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; + // 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; + // 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; + // 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; + // 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