File tree Expand file tree Collapse file tree 5 files changed +47
-0
lines changed Expand file tree Collapse file tree 5 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ export interface CSSOMRule extends CSSRule {
2
+ index : number ;
3
+ style : CSSStyleDeclaration ;
4
+ styleMap : any ;
5
+ }
6
+
7
+ export interface AddonCSSOM {
8
+ /**
9
+ * @param selector CSS rule selector string.
10
+ * @param prelude Media query at-rule prelude string.
11
+ */
12
+ createRule ( selector : string , prelude : string ) : CSSOMRule ;
13
+ }
14
+
15
+ export function addon < Nano extends { sh : HTMLStyleElement } > ( nano : Nano ) : Nano & AddonCSSOM ;
Original file line number Diff line number Diff line change
1
+ import { AddonCSSOM } from './cssom' ;
2
+ import { Css } from './vcssom/cssToTree' ;
3
+
4
+ export interface VSheet {
5
+ diff ( css : Css ) ;
6
+ }
7
+
8
+ export interface AddonVCSSOM {
9
+ VSheet : new ( ) => VSheet ;
10
+ }
11
+
12
+ export function addon < Nano extends AddonCSSOM > ( nano : Nano ) : Nano & AddonVCSSOM ;
Original file line number Diff line number Diff line change
1
+ import { CssLikeObject } from '../../types/common' ;
2
+
3
+ export interface Css {
4
+ [ key : string ] : CssLikeObject [ keyof CssLikeObject ] | Css ;
5
+ }
6
+
7
+ export interface Tree {
8
+ [ atRulePrelude : string ] : {
9
+ [ selector : string ] : {
10
+ [ property : string ] : CssLikeObject ;
11
+ } ;
12
+ } ;
13
+ }
14
+
15
+ export function cssToTree ( css : Css ) : Tree ;
Original file line number Diff line number Diff line change
1
+ import { CSSOMRule } from '../cssom' ;
2
+
3
+ export function removeRule ( sh : CSSStyleSheet , rule : CSSOMRule ) ;
Original file line number Diff line number Diff line change
1
+ // TODO: `rule` should have a reference to stylesheet it is contained in,
2
+ // maybe we don't need to pass `sh` in here.
1
3
function removeRule ( sh , rule ) {
2
4
var maxIndex = rule . index ;
3
5
var rules = sh . cssRules || sh . rules ;
You can’t perform that action at this time.
0 commit comments