File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,15 @@ export interface PluginStringMap {
3939 replace : strings ;
4040}
4141
42+ export type RTLCSSPlugin = {
43+ name : string ;
44+ priority : number ;
45+ directives : {
46+ control : Object ,
47+ value : Array < Object >
48+ } ;
49+ }
50+
4251export interface DeclarationPluginProcessor {
4352 expr : RegExp ;
4453 action : ( prop : string , value : string , context : object ) => object ;
@@ -72,8 +81,9 @@ export interface PluginOptions {
7281 processDeclarationPlugins ?: DeclarationPlugin [ ] ;
7382}
7483
75- export interface PluginOptionsNormalized extends Omit < Required < PluginOptions > , 'stringMap' | 'prefixSelectorTransformer' > {
84+ export interface PluginOptionsNormalized extends Omit < Required < PluginOptions > , 'stringMap' | 'processDeclarationPlugins' | ' prefixSelectorTransformer'> {
7685 stringMap : StringMap [ ] ;
86+ plugins : RTLCSSPlugin [ ] ;
7787 prefixSelectorTransformer : PrefixSelectorTransformer | null ;
7888}
7989
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ const defaultOptions = (): PluginOptionsNormalized => ({
160160 stringMap : getRTLCSSStringMap ( defaultStringMap ) ,
161161 greedy : false ,
162162 aliases : { } ,
163- processDeclarationPlugins : [ ]
163+ plugins : [ ]
164164} ) ;
165165
166166const store : Store = {
@@ -232,7 +232,7 @@ const normalizeOptions = (options: PluginOptions): PluginOptionsNormalized => {
232232 } ) ;
233233 }
234234 if ( isAcceptedProcessDeclarationPlugins ( options . processDeclarationPlugins ) ) {
235- returnOptions . processDeclarationPlugins = options . processDeclarationPlugins . map ( plugin => ( {
235+ returnOptions . plugins = options . processDeclarationPlugins . map ( plugin => ( {
236236 ...plugin , directives : { control : { } , value : [ ] } ,
237237 } ) ) ;
238238 }
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export const parseDeclarations = (
6060 stringMap,
6161 greedy,
6262 aliases,
63- processDeclarationPlugins
63+ plugins
6464 } = store . options ;
6565
6666 const deleteDeclarations : Declaration [ ] = [ ] ;
@@ -161,7 +161,7 @@ export const parseDeclarations = (
161161 stringMap,
162162 greedy,
163163 aliases
164- } , processDeclarationPlugins ) ;
164+ } , plugins ) ;
165165
166166 /* the source could be undefined in certain cases but not during the tests */
167167 /* istanbul ignore next */
You can’t perform that action at this time.
0 commit comments