@tamagui/types 2.7.7 → 3.0.0-beta.1093.1

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.
Files changed (3) hide show
  1. package/package.json +5 -3
  2. package/types.d.ts +179 -0
  3. package/types.ts +42 -13
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@tamagui/types",
3
- "version": "2.7.7",
3
+ "version": "3.0.0-beta.1093.1",
4
+ "license": "MIT",
4
5
  "files": [
5
- "types.ts"
6
+ "types.ts",
7
+ "types.d.ts"
6
8
  ],
7
9
  "type": "module",
8
10
  "sideEffects": false,
9
- "types": "./types.ts",
11
+ "types": "./types.d.ts",
10
12
  "exports": {
11
13
  ".": {
12
14
  "types": "./types.ts"
package/types.d.ts ADDED
@@ -0,0 +1,179 @@
1
+ export interface TamaguiBuildOptions {
2
+ /** Project root used to resolve compiler config and component modules. */
3
+ root?: string
4
+ /**
5
+ * Component packages to evaluate up front (default ['tamagui']). The compiler
6
+ * discovers any other package a JSX element or styled() base imports from as
7
+ * it compiles, so this is an optional warm-up, not a requirement.
8
+ */
9
+ components?: string[]
10
+ /**
11
+ * Dangerous escape hatch for runtime-only modules that the compiler should
12
+ * not evaluate while loading the Tamagui config and configured components.
13
+ *
14
+ * Ignored modules receive an empty object during static evaluation, which
15
+ * weakens the compiler's correctness check. Only add a module when its
16
+ * exports are not used to create the config or components.
17
+ */
18
+ dangerouslyIgnoreStaticEvaluationModules?: string[]
19
+ /**
20
+ * relative path to your tamagui.config.ts
21
+ */
22
+ config?: string
23
+ /**
24
+ * Use the new ThemeBuilder in `@tamagui/create-theme` to create beautiful theme sets,
25
+ * see docs at https://tamagui.dev/docs/guides/theme-builder
26
+ * This helps you automate generating the build themes typescript file which loads fastere
27
+ * and has smaller bundle size.
28
+ */
29
+ themeBuilder?: {
30
+ input: string
31
+ output: string
32
+ }
33
+ /**
34
+ * Emit design system related CSS during build step for usage with frameworks
35
+ */
36
+ outputCSS?: string | null | false
37
+ /**
38
+ * (Experimental) outputs themes using CSS Nesting https://caniuse.com/css-nesting
39
+ * Which can cut them in half due to no media query duplication.
40
+ */
41
+ useCSSNesting?: boolean
42
+ /**
43
+ * Tamagui can follow imports and evaluate them when parsing styles, leading to
44
+ * higher percent of flattened / optimized views. We normalize this to be the
45
+ * full path of the file, always ending in ".js".
46
+ *
47
+ * So to have Tamagui partially evaluate "app/src/constants.tsx" you can put
48
+ * ["app/src/constants.js"].
49
+ */
50
+ importsWhitelist?: string[]
51
+ /**
52
+ * Whitelist file extensions to evaluate
53
+ *
54
+ * @default ['.tsx', '.jsx']
55
+ */
56
+ includeExtensions?: string[]
57
+ /**
58
+ * Web-only. Allows you to trim the bundle size of react-native-web.
59
+ * Pass in values like ['Switch', 'Modal'].
60
+ */
61
+ excludeReactNativeWebExports?: string[]
62
+ /**
63
+ * Enable logging the time it takes to extract.
64
+ *
65
+ * @default true
66
+ */
67
+ logTimings?: boolean
68
+ /**
69
+ * Custom prefix for the timing logs
70
+ */
71
+ prefixLogs?: string
72
+ /**
73
+ * Completely disable tamagui for these files
74
+ */
75
+ disable?: boolean | string[]
76
+ /**
77
+ * Disable just optimization for these files, but enable helpful debug attributes.
78
+ */
79
+ disableExtraction?: boolean | string[]
80
+ /**
81
+ * Disable partial extraction (extracting static style props into CSS beside
82
+ * retained runtime props on the same element). Elements with dynamic style
83
+ * props stay fully on the runtime path instead.
84
+ */
85
+ disablePartialExtraction?: boolean
86
+ /**
87
+ * Disable just the addition of data- attributes that are added in dev mode to help
88
+ * tie DOM to your filename/component-name.
89
+ */
90
+ disableDebugAttr?: boolean
91
+ /**
92
+ * (Advanced) Disable evaluation of useMedia() hook
93
+ */
94
+ disableExtractInlineMedia?: boolean
95
+ /**
96
+ * (Advanced) Disable just view flattening.
97
+ */
98
+ disableFlattening?: boolean
99
+ /**
100
+ * (Advanced) Disable extracting to theme variables.
101
+ */
102
+ disableExtractVariables?: boolean | 'theme'
103
+ /**
104
+ * (Advanced) Disables the initial build and attempts to load from the .tamagui directory
105
+ */
106
+ disableInitialBuild?: boolean
107
+ /**
108
+ * If you have a tamagui.build.ts file that describes your compiler setup, you can set it here
109
+ */
110
+ buildFile?: string
111
+ evaluateVars?: boolean
112
+ cssPath?: string
113
+ cssData?: any
114
+ deoptProps?: Set<string>
115
+ excludeProps?: Set<string>
116
+ inlineProps?: Set<string>
117
+ /**
118
+ * Use react-native-web-lite for better tree shaking on web.
119
+ * Set to 'without-animated' to exclude animated components.
120
+ */
121
+ useReactNativeWebLite?: boolean | 'without-animated'
122
+ disableWatchTamaguiConfig?: boolean
123
+ experimental?: {
124
+ /**
125
+ * Emit native flattened views with theme-token mappings for the experimental
126
+ * native style engine. Web output is unaffected.
127
+ */
128
+ nativeFastPath?: boolean
129
+ /**
130
+ * (Experimental, web only) Build a zero-runtime web entry graph.
131
+ *
132
+ * - `'report'` runs every zero analysis and writes the report, but keeps the
133
+ * full runtime and exits successfully.
134
+ * - `true` enforces the contract and builds one zero-runtime entry graph.
135
+ * - `{ islands }` also treats each listed module glob as the root of a
136
+ * separately compiled full-runtime entry.
137
+ */
138
+ zeroRuntime?:
139
+ | true
140
+ | 'report'
141
+ | {
142
+ islands: string[]
143
+ }
144
+ }
145
+ }
146
+ export interface TamaguiOptions extends TamaguiBuildOptions {
147
+ platform?: 'native' | 'web'
148
+ }
149
+ export type CLIUserOptions = {
150
+ root?: string
151
+ host?: string
152
+ tsconfigPath?: string
153
+ tamaguiOptions: Partial<TamaguiOptions>
154
+ debug?: boolean | 'verbose'
155
+ loadTamaguiOptions?: boolean
156
+ }
157
+ export type CLIResolvedOptions = {
158
+ root: string
159
+ port?: number
160
+ host?: string
161
+ mode: 'development' | 'production'
162
+ debug?: CLIUserOptions['debug']
163
+ tsconfigPath: string
164
+ tamaguiOptions: TamaguiOptions
165
+ pkgJson: {
166
+ name?: string
167
+ main?: string
168
+ module?: string
169
+ source?: string
170
+ exports?: Record<string, Record<string, string>>
171
+ }
172
+ paths: {
173
+ root: string
174
+ dotDir: string
175
+ conf: string
176
+ types: string
177
+ }
178
+ }
179
+ //# sourceMappingURL=types.d.ts.map
package/types.ts CHANGED
@@ -1,9 +1,24 @@
1
1
  export interface TamaguiBuildOptions {
2
+ /** Project root used to resolve compiler config and component modules. */
3
+ root?: string
4
+
2
5
  /**
3
- * module paths you want to compile with tamagui (for example ['tamagui'])
4
- * */
6
+ * Component packages to evaluate up front (default ['tamagui']). The compiler
7
+ * discovers any other package a JSX element or styled() base imports from as
8
+ * it compiles, so this is an optional warm-up, not a requirement.
9
+ */
5
10
  components?: string[]
6
11
 
12
+ /**
13
+ * Dangerous escape hatch for runtime-only modules that the compiler should
14
+ * not evaluate while loading the Tamagui config and configured components.
15
+ *
16
+ * Ignored modules receive an empty object during static evaluation, which
17
+ * weakens the compiler's correctness check. Only add a module when its
18
+ * exports are not used to create the config or components.
19
+ */
20
+ dangerouslyIgnoreStaticEvaluationModules?: string[]
21
+
7
22
  /**
8
23
  * relative path to your tamagui.config.ts
9
24
  */
@@ -66,13 +81,6 @@ export interface TamaguiBuildOptions {
66
81
  */
67
82
  prefixLogs?: string
68
83
 
69
- /**
70
- * (Advanced) Enables Tamagui to try and evaluate components outside the `components` option.
71
- * When true, Tamagui will bundle and load components as its running across every file,
72
- * if it loads them successfully it will perform all optimiziations inline.
73
- */
74
- enableDynamicEvaluation?: boolean
75
-
76
84
  /**
77
85
  * Completely disable tamagui for these files
78
86
  */
@@ -83,6 +91,13 @@ export interface TamaguiBuildOptions {
83
91
  */
84
92
  disableExtraction?: boolean | string[]
85
93
 
94
+ /**
95
+ * Disable partial extraction (extracting static style props into CSS beside
96
+ * retained runtime props on the same element). Elements with dynamic style
97
+ * props stay fully on the runtime path instead.
98
+ */
99
+ disablePartialExtraction?: boolean
100
+
86
101
  /**
87
102
  * Disable just the addition of data- attributes that are added in dev mode to help
88
103
  * tie DOM to your filename/component-name.
@@ -129,10 +144,24 @@ export interface TamaguiBuildOptions {
129
144
  useReactNativeWebLite?: boolean | 'without-animated'
130
145
  disableWatchTamaguiConfig?: boolean
131
146
 
132
- /**
133
- * (Experimental) Flatten theme access on native for better performance
134
- */
135
- experimentalFlattenThemesOnNative?: boolean
147
+ experimental?: {
148
+ /**
149
+ * Emit native flattened views with theme-token mappings for the experimental
150
+ * native style engine. Web output is unaffected.
151
+ */
152
+ nativeFastPath?: boolean
153
+
154
+ /**
155
+ * (Experimental, web only) Build a zero-runtime web entry graph.
156
+ *
157
+ * - `'report'` runs every zero analysis and writes the report, but keeps the
158
+ * full runtime and exits successfully.
159
+ * - `true` enforces the contract and builds one zero-runtime entry graph.
160
+ * - `{ islands }` also treats each listed module glob as the root of a
161
+ * separately compiled full-runtime entry.
162
+ */
163
+ zeroRuntime?: true | 'report' | { islands: string[] }
164
+ }
136
165
  }
137
166
 
138
167
  export interface TamaguiOptions extends TamaguiBuildOptions {