@stylexjs/babel-plugin 0.2.0-beta.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/flow_modules/@babel/core/index.js.flow +854 -0
- package/flow_modules/@babel/generator/index.js.flow +216 -0
- package/flow_modules/@babel/helper-module-imports/index.js.flow +182 -0
- package/flow_modules/@babel/parser/index.js.flow +253 -0
- package/flow_modules/@babel/traverse/index.js.flow +1003 -0
- package/flow_modules/@babel/types/index.js.flow +5224 -0
- package/lib/babel-path-utils.d.ts +1100 -0
- package/lib/babel-path-utils.js.flow +1108 -0
- package/lib/index.d.ts +46 -0
- package/lib/index.js +4082 -2822
- package/lib/index.js.flow +50 -0
- package/lib/utils/dev-classname.d.ts +26 -0
- package/lib/utils/dev-classname.js.flow +31 -0
- package/lib/utils/evaluate-path.d.ts +29 -0
- package/lib/utils/evaluate-path.js.flow +37 -0
- package/lib/utils/helpers.d.ts +12 -0
- package/lib/utils/helpers.js.flow +10 -0
- package/lib/utils/js-to-ast.d.ts +23 -0
- package/lib/utils/js-to-ast.js.flow +25 -0
- package/lib/utils/state-manager.d.ts +110 -0
- package/lib/utils/state-manager.js.flow +91 -0
- package/lib/visitors/imports.d.ts +20 -0
- package/lib/visitors/imports.js.flow +24 -0
- package/lib/visitors/stylex-create/index.d.ts +17 -0
- package/lib/visitors/stylex-create/index.js.flow +24 -0
- package/lib/visitors/stylex-create/parse-stylex-create-arg.d.ts +28 -0
- package/lib/visitors/stylex-create/parse-stylex-create-arg.js.flow +30 -0
- package/lib/visitors/stylex-create-theme.d.ts +17 -0
- package/lib/visitors/stylex-create-theme.js.flow +23 -0
- package/lib/visitors/stylex-define-vars.d.ts +17 -0
- package/lib/visitors/stylex-define-vars.js.flow +23 -0
- package/lib/visitors/stylex-keyframes.d.ts +17 -0
- package/lib/visitors/stylex-keyframes.js.flow +23 -0
- package/lib/visitors/stylex-merge.d.ts +21 -0
- package/lib/visitors/stylex-merge.js.flow +25 -0
- package/lib/visitors/stylex-props.d.ts +21 -0
- package/lib/visitors/stylex-props.js.flow +25 -0
- package/package.json +15 -13
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { PluginObj } from '@babel/core';
|
|
11
|
+
import type { StyleXOptions } from './utils/state-manager';
|
|
12
|
+
export type Options = StyleXOptions;
|
|
13
|
+
/**
|
|
14
|
+
* Entry point for the StyleX babel plugin.
|
|
15
|
+
*/
|
|
16
|
+
declare function styleXTransform(): PluginObj;
|
|
17
|
+
declare function stylexPluginWithOptions(
|
|
18
|
+
options: Partial<StyleXOptions>,
|
|
19
|
+
): [typeof styleXTransform, Partial<StyleXOptions>];
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param rules An array of CSS rules that has been generated and collected from all JS files
|
|
23
|
+
* in a project
|
|
24
|
+
* @returns A string that represents the final CSS file.
|
|
25
|
+
*
|
|
26
|
+
* This function take an Array of CSS rules, de-duplicates them, sorts them priority and generates
|
|
27
|
+
* a final CSS file.
|
|
28
|
+
*
|
|
29
|
+
* When Stylex is correctly configured, the babel plugin will return an array of CSS rule objects.
|
|
30
|
+
* You're expected to concatenate all the Rules into a single Array and use this function to convert
|
|
31
|
+
* that into the final CSS file.
|
|
32
|
+
*
|
|
33
|
+
* End-users can choose to not use this function and use their own logic instead.
|
|
34
|
+
*/
|
|
35
|
+
export type Rule = [string, { ltr: string; rtl?: null | string }, number];
|
|
36
|
+
declare function processStylexRules(
|
|
37
|
+
rules: Array<Rule>,
|
|
38
|
+
useLayers: boolean,
|
|
39
|
+
): string;
|
|
40
|
+
export type StyleXTransformObj = Readonly<{
|
|
41
|
+
(): PluginObj;
|
|
42
|
+
withOptions: typeof stylexPluginWithOptions;
|
|
43
|
+
processStylexRules: typeof processStylexRules;
|
|
44
|
+
}>;
|
|
45
|
+
declare const $$EXPORT_DEFAULT_DECLARATION$$: StyleXTransformObj;
|
|
46
|
+
export default $$EXPORT_DEFAULT_DECLARATION$$;
|