From c62e79e17b59a4f623ba74222f52c8d55ceaa6ef Mon Sep 17 00:00:00 2001 From: Vasil Chimev Date: Tue, 13 Jun 2017 09:38:15 +0300 Subject: [PATCH] fix: add css-agent declarations (#4361) * fix: add css-agent declarations * fix: remove css-agent ts --- tns-core-modules/debugger/css-agent.d.ts | 59 +++++++++++++++++ tns-core-modules/debugger/css-agent.ts | 81 ------------------------ 2 files changed, 59 insertions(+), 81 deletions(-) create mode 100644 tns-core-modules/debugger/css-agent.d.ts delete mode 100644 tns-core-modules/debugger/css-agent.ts diff --git a/tns-core-modules/debugger/css-agent.d.ts b/tns-core-modules/debugger/css-agent.d.ts new file mode 100644 index 000000000..093451d15 --- /dev/null +++ b/tns-core-modules/debugger/css-agent.d.ts @@ -0,0 +1,59 @@ +export interface CSSProperty { + name: string; + value: string; + disabled: boolean; +} +export interface ShorthandEntry { + name: string; + value: string; +} +export interface CSSStyle { + cssProperties: CSSProperty[]; + shorthandEntries: ShorthandEntry[]; + cssText?: string; +} +export interface Value { + text: string; +} +export interface SelectorList { + selectors: Value[]; + text: string; +} +export interface CSSRule { + selectorList: SelectorList; + origin: string; + style: CSSStyle; + styleSheetId?: string; +} +export interface RuleMatch { + rule: CSSRule; + matchingSelectors: number[]; +} +export interface InheritedStyleEntry { + matchedCSSRules: RuleMatch[]; + inlineStyle?: CSSStyle; +} +export interface CSSComputedStyleProperty { + name: string; + value: string; +} +export interface PlatformFontUsage { + familyName: string; + glyphCount: number; + isCustomFont: boolean; +} +export interface CSSStyleSheetHeader { + styleSheetId: string; + frameId: string; + sourceUrl: string; + origin: string; + title: string; + disabled: boolean; + isInLine: boolean; + startLine: number; + startColumn: number; +} +export interface PseudoElementMatches { + pseudoType: string; + matches: RuleMatch[]; +} diff --git a/tns-core-modules/debugger/css-agent.ts b/tns-core-modules/debugger/css-agent.ts deleted file mode 100644 index 9426eae3c..000000000 --- a/tns-core-modules/debugger/css-agent.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - On element select in the inspector the following are requested: - - Inline styles -> CSSStyle - - Attributes styles -> CSSStyle (Appears as 'Stacklayout[Attributes style]` - unsure of its purpose) irrelevant? - - Style matches -> RuleMatch[] - - Inherited styles -> InheritedStyleEntry[] - - Pseudo Element matches -> PseudoElementMatches[] - - Computed Styles for node -> CSSComputedStyleProperty[] - - Element Fonts -> PlatformFontUsage -*/ - -export interface CSSProperty { - name: string - value: string - disabled: boolean // strikes out the disabled property -} - -export interface ShorthandEntry { // seems irrelevant - feel free to leave empty for now - name: string - value: string -} - -export interface CSSStyle { - cssProperties: CSSProperty[] - shorthandEntries: ShorthandEntry[] // doesn't seem to display anywhere - cssText?: string -} - -export interface Value { - text: string -} - -export interface SelectorList { // e.g. [".btn", "Button", "Label"] - selectors: Value[] - text: string // doesn't seem to display anywhere -} - -export interface CSSRule { - selectorList: SelectorList - origin: string // a constant - "regular" - style: CSSStyle - styleSheetId?: string // associated stylesheet -} - -export interface RuleMatch { - rule: CSSRule - matchingSelectors: number[] // index-based - the index of the selector that the node currently inspected matches -} - -export interface InheritedStyleEntry { - matchedCSSRules: RuleMatch[] - inlineStyle?: CSSStyle -} - -export interface CSSComputedStyleProperty { - name: string - value: string -} - -export interface PlatformFontUsage { - familyName: string - glyphCount: number // number of characters in text of element - isCustomFont: boolean -} - -export interface CSSStyleSheetHeader { - styleSheetId: string // a unique identifier - file name/path should do - frameId: string // constant - sourceUrl: string - origin: string // constant - title: string // the same as the id? - disabled: boolean // false - if the css has been invalidated/disabled - isInLine: boolean // false - startLine: number // constant - 1 - startColumn: number // constant - 1 -} - -export interface PseudoElementMatches { - pseudoType: string // e.g. last-child - matches: RuleMatch[] -} \ No newline at end of file