@next-box/appsettings 0.0.7 → 0.0.8

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 (50) hide show
  1. package/README.md +59 -14
  2. package/dist/cjs/hooks/createUseAppSettings.cjs +2 -0
  3. package/dist/cjs/hooks/createUseAppSettings.cjs.map +1 -0
  4. package/dist/cjs/hooks/createUseSetting.cjs +2 -0
  5. package/dist/cjs/hooks/createUseSetting.cjs.map +1 -0
  6. package/dist/cjs/index.cjs +1 -1
  7. package/dist/esm/hooks/createUseAppSettings.mjs +2 -0
  8. package/dist/esm/hooks/createUseAppSettings.mjs.map +1 -0
  9. package/dist/esm/hooks/createUseSetting.mjs +2 -0
  10. package/dist/esm/hooks/createUseSetting.mjs.map +1 -0
  11. package/dist/esm/index.mjs +1 -1
  12. package/dist/production.analysis.txt +25 -25
  13. package/dist/types/cjs/hooks/createUseAppSettings.d.cts +4 -0
  14. package/dist/types/cjs/hooks/createUseAppSettings.d.cts.map +1 -0
  15. package/dist/types/cjs/hooks/createUseSetting.d.cts +4 -0
  16. package/dist/types/cjs/hooks/createUseSetting.d.cts.map +1 -0
  17. package/dist/types/cjs/index.d.cts +2 -4
  18. package/dist/types/cjs/index.d.cts.map +1 -1
  19. package/dist/types/esm/hooks/createUseAppSettings.d.ts +4 -0
  20. package/dist/types/esm/hooks/createUseAppSettings.d.ts.map +1 -0
  21. package/dist/types/esm/hooks/createUseSetting.d.ts +4 -0
  22. package/dist/types/esm/hooks/createUseSetting.d.ts.map +1 -0
  23. package/dist/types/esm/index.d.ts +2 -4
  24. package/dist/types/esm/index.d.ts.map +1 -1
  25. package/dist/types/tsconfig.build.tsbuildinfo +1 -1
  26. package/package.json +1 -1
  27. package/src/components/AppSettingsProvider.test.tsx +4 -1
  28. package/src/hooks/{useAppSetting.test.tsx → createUseAppSetting.test.tsx} +12 -6
  29. package/src/hooks/{useAppSettings.test.tsx → createUseAppSettings.test.tsx} +5 -3
  30. package/src/hooks/createUseAppSettings.ts +12 -0
  31. package/src/hooks/createUseSetting.ts +12 -0
  32. package/src/index.ts +2 -6
  33. package/dist/cjs/hooks/useAppSetting.cjs +0 -2
  34. package/dist/cjs/hooks/useAppSetting.cjs.map +0 -1
  35. package/dist/cjs/hooks/useAppSettings.cjs +0 -2
  36. package/dist/cjs/hooks/useAppSettings.cjs.map +0 -1
  37. package/dist/esm/hooks/useAppSetting.mjs +0 -2
  38. package/dist/esm/hooks/useAppSetting.mjs.map +0 -1
  39. package/dist/esm/hooks/useAppSettings.mjs +0 -2
  40. package/dist/esm/hooks/useAppSettings.mjs.map +0 -1
  41. package/dist/types/cjs/hooks/useAppSetting.d.cts +0 -6
  42. package/dist/types/cjs/hooks/useAppSetting.d.cts.map +0 -1
  43. package/dist/types/cjs/hooks/useAppSettings.d.cts +0 -6
  44. package/dist/types/cjs/hooks/useAppSettings.d.cts.map +0 -1
  45. package/dist/types/esm/hooks/useAppSetting.d.ts +0 -6
  46. package/dist/types/esm/hooks/useAppSetting.d.ts.map +0 -1
  47. package/dist/types/esm/hooks/useAppSettings.d.ts +0 -6
  48. package/dist/types/esm/hooks/useAppSettings.d.ts.map +0 -1
  49. package/src/hooks/useAppSetting.ts +0 -14
  50. package/src/hooks/useAppSettings.ts +0 -17
package/README.md CHANGED
@@ -80,9 +80,9 @@ export default async function RootLayout({ children }: { children: React.ReactNo
80
80
 
81
81
  return (
82
82
  <html lang="en">
83
- <body>
84
- <AppSettingsProvider settings={settings}>{children}</AppSettingsProvider>
85
- </body>
83
+ <body>
84
+ <AppSettingsProvider settings={settings}>{children}</AppSettingsProvider>
85
+ </body>
86
86
  </html>
87
87
  );
88
88
  }
@@ -132,35 +132,80 @@ Each later source overrides earlier values according to the merge rules describe
132
132
 
133
133
  ### Read settings
134
134
 
135
- Paths use dot notation. `useAppSetting` reads a leaf value and `useAppSettings` reads an object section:
135
+ Paths use dot notation. The library provides two hook factories:
136
+
137
+ - `createUseSetting` creates a hook for reading individual setting values.
138
+ - `createUseAppSettings` creates a hook for reading object sections.
139
+
140
+ Both factories accept your application's settings type and return a fully typed React hook.
141
+
142
+ #### Create typed hooks
143
+
144
+ Create the hooks once, outside your React components:
145
+
146
+ ```ts
147
+ // ./src/hooks/appSettings.ts
148
+ 'use client';
149
+
150
+ import {
151
+ createUseAppSettings,
152
+ createUseSetting,
153
+ } from '@next-box/appsettings';
154
+
155
+ import type { AppSettingsConfig } from '../appSettings.schema';
156
+
157
+ export const useSetting = createUseSetting<AppSettingsConfig>();
158
+
159
+ export const useAppSettings = createUseAppSettings<AppSettingsConfig>();
160
+ ```
161
+
162
+ #### Use the hooks in components
136
163
 
137
164
  ```tsx
138
165
  // ./src/ApiTimeout.tsx
139
166
  'use client';
140
167
 
141
- import { useAppSetting, useAppSettings } from '@next-box/appsettings';
168
+ import { useAppSettings, useSetting } from './hooks/appSettings';
142
169
 
143
170
  export const ApiTimeout = () => {
144
- const timeout = useAppSetting('Api.Timeout');
171
+ const timeout = useSetting('Api.Timeout');
172
+ const api = useAppSettings('Api');
145
173
  const features = useAppSettings('Features');
146
174
 
147
- return <span>{features?.DarkMode ? timeout : 'Disabled'}</span>;
175
+ return (
176
+ <span>
177
+ {features?.DarkMode ? `${api?.BaseUrl} (${timeout}ms)` : 'Disabled'}
178
+ </span>
179
+ );
148
180
  };
149
181
  ```
150
182
 
151
- The settings snapshot is read-only. Configuration is loaded and validated before it reaches the provider; there are no client-side mutation or reload methods.
183
+ #### Type inference
184
+
185
+ Given the `AppSettingsConfig` schema defined above:
152
186
 
153
- Leaf paths and their values are checked against the inferred schema. The reader uses bounded nested path types and `type-fest`'s `Get<T, P>` for path value types.
187
+ ```ts
188
+ const timeout = useSetting('Api.Timeout');
189
+ // number | undefined
154
190
 
155
- React context cannot infer the settings type from a provider at a separate hook call site. Generate a module augmentation from the exported schema type:
191
+ const baseUrl = useSetting('Api.BaseUrl');
192
+ // string | undefined
156
193
 
157
- ```shell
158
- pnpm exec appsettings generate-types ./src/appSettings.schema.ts ./src/appSettings.generated.d.ts --type AppSettingsConfig
194
+ const api = useAppSettings('Api');
195
+ // { BaseUrl: string; Timeout: number } | undefined
196
+
197
+ const features = useAppSettings('Features');
198
+ // { DarkMode: boolean; NewDashboard: boolean } | undefined
199
+
200
+ useSetting('Api.InvalidProperty');
201
+ // TypeScript error
159
202
  ```
160
203
 
161
- The command writes a declaration that imports `AppSettingsConfig` and augments the package's `AppSettingsSchema`. TypeScript then infers each hook result from the value type at the end of its path. Zod enums and literals stay precise, while `z.string()` and `z.number()` remain broad types. The declaration only provides types; configuration still loads and validates on the server.
204
+ Both hooks return `undefined` when the requested path does not exist.
205
+
206
+ The settings snapshot is read-only. Configuration is loaded and validated before it reaches the provider; there are no client-side mutation or reload methods.
162
207
 
163
- Run the command after changing the schema, or add it to the consuming application's `predev`, `prebuild`, and type-check scripts so the declaration stays current. The generated file must be included by the application's `tsconfig.json`.
208
+ No module augmentation or generated declaration files are required. Each application supplies its settings type explicitly when creating its hooks.
164
209
 
165
210
  ### Conditionally render with `Setting`
166
211
 
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("./useAppSettingsContext.cjs");exports.createUseAppSettings=()=>t=>e.useAppSettingsContext().read(t);
2
+ //# sourceMappingURL=createUseAppSettings.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUseAppSettings.cjs","sources":["../../../src/hooks/createUseAppSettings.ts"],"sourcesContent":["import { type Get } from 'type-fest';\nimport { type SettingSectionPath } from '#types/Config.types.ts';\nimport { useAppSettingsContext } from './useAppSettingsContext.ts';\n\nexport const createUseAppSettings = <T extends object>() => {\n return <P extends SettingSectionPath<T>>(path: P): Get<T, P> | undefined => {\n const settings = useAppSettingsContext();\n // Assert the resolved settings type based on the caller-provided schema and path.\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n return settings.read(path) as Get<T, P> | undefined;\n };\n};\n"],"names":["path","useAppSettingsContext","read"],"mappings":"uFAIoC,IACOA,GACtBC,EAAAA,wBAGDC,KAAKF"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("./useAppSettingsContext.cjs");exports.createUseSetting=()=>t=>e.useAppSettingsContext().read(t);
2
+ //# sourceMappingURL=createUseSetting.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUseSetting.cjs","sources":["../../../src/hooks/createUseSetting.ts"],"sourcesContent":["import { type Get } from 'type-fest';\nimport { useAppSettingsContext } from '#hooks/useAppSettingsContext.ts';\nimport { type SettingPath } from '#types/Config.types.ts';\n\nexport const createUseSetting = <T extends object>() => {\n return <P extends SettingPath<T>>(path: P): Get<T, P> | undefined => {\n const settings = useAppSettingsContext();\n // Assert the resolved setting type based on the caller-provided schema and path.\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n return settings.read(path) as Get<T, P> | undefined;\n };\n};\n"],"names":["path","useAppSettingsContext","read"],"mappings":"mFAIgC,IACIA,GACfC,EAAAA,wBAGDC,KAAKF"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("./components/AppSettingsProvider.cjs"),t=require("./components/Setting.cjs"),s=require("./hooks/useAppSetting.cjs"),p=require("./hooks/useAppSettings.cjs"),i=require("./hooks/useAppSettingsContext.cjs");exports.AppSettingsProvider=e.AppSettingsProvider,exports.Setting=t.Setting,exports.useAppSetting=s.useAppSetting,exports.useAppSettings=p.useAppSettings,exports.useAppSettingsContext=i.useAppSettingsContext;
1
+ "use strict";var e=require("./components/AppSettingsProvider.cjs"),t=require("./components/Setting.cjs"),s=require("./hooks/createUseSetting.cjs"),r=require("./hooks/createUseAppSettings.cjs"),p=require("./hooks/useAppSettingsContext.cjs");exports.AppSettingsProvider=e.AppSettingsProvider,exports.Setting=t.Setting,exports.createUseSetting=s.createUseSetting,exports.createUseAppSettings=r.createUseAppSettings,exports.useAppSettingsContext=p.useAppSettingsContext;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,2 @@
1
+ import{useAppSettingsContext as t}from"./useAppSettingsContext.mjs";const e=()=>e=>t().read(e);export{e as createUseAppSettings};
2
+ //# sourceMappingURL=createUseAppSettings.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUseAppSettings.mjs","sources":["../../../src/hooks/createUseAppSettings.ts"],"sourcesContent":["import { type Get } from 'type-fest';\nimport { type SettingSectionPath } from '#types/Config.types.ts';\nimport { useAppSettingsContext } from './useAppSettingsContext.ts';\n\nexport const createUseAppSettings = <T extends object>() => {\n return <P extends SettingSectionPath<T>>(path: P): Get<T, P> | undefined => {\n const settings = useAppSettingsContext();\n // Assert the resolved settings type based on the caller-provided schema and path.\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n return settings.read(path) as Get<T, P> | undefined;\n };\n};\n"],"names":["createUseAppSettings","path","useAppSettingsContext","read"],"mappings":"0EAIaA,EAAuB,IACOC,GACtBC,IAGDC,KAAKF"}
@@ -0,0 +1,2 @@
1
+ import{useAppSettingsContext as t}from"./useAppSettingsContext.mjs";const e=()=>e=>t().read(e);export{e as createUseSetting};
2
+ //# sourceMappingURL=createUseSetting.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUseSetting.mjs","sources":["../../../src/hooks/createUseSetting.ts"],"sourcesContent":["import { type Get } from 'type-fest';\nimport { useAppSettingsContext } from '#hooks/useAppSettingsContext.ts';\nimport { type SettingPath } from '#types/Config.types.ts';\n\nexport const createUseSetting = <T extends object>() => {\n return <P extends SettingPath<T>>(path: P): Get<T, P> | undefined => {\n const settings = useAppSettingsContext();\n // Assert the resolved setting type based on the caller-provided schema and path.\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n return settings.read(path) as Get<T, P> | undefined;\n };\n};\n"],"names":["createUseSetting","path","useAppSettingsContext","read"],"mappings":"0EAIaA,EAAmB,IACIC,GACfC,IAGDC,KAAKF"}
@@ -1,2 +1,2 @@
1
- export{AppSettingsProvider}from"./components/AppSettingsProvider.mjs";export{Setting}from"./components/Setting.mjs";export{useAppSetting}from"./hooks/useAppSetting.mjs";export{useAppSettings}from"./hooks/useAppSettings.mjs";export{useAppSettingsContext}from"./hooks/useAppSettingsContext.mjs";
1
+ export{AppSettingsProvider}from"./components/AppSettingsProvider.mjs";export{Setting}from"./components/Setting.mjs";export{createUseSetting}from"./hooks/createUseSetting.mjs";export{createUseAppSettings}from"./hooks/createUseAppSettings.mjs";export{useAppSettingsContext}from"./hooks/useAppSettingsContext.mjs";
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,78 +1,78 @@
1
1
  -----------------------------
2
2
  Rollup File Analysis
3
3
  -----------------------------
4
- bundle size: 5.056 KB
4
+ bundle size: 5.215 KB
5
5
  original size: 8.074 KB
6
- code reduction: 37.38 %
6
+ code reduction: 35.41 %
7
7
  module count: 9
8
8
 
9
9
  ███████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
10
10
  file: /src/sources/EnvironmentSource.ts
11
- bundle space: 31.67 %
12
- rendered size: 1.601 KB
11
+ bundle space: 31.1 %
12
+ rendered size: 1.622 KB
13
13
  original size: 2.006 KB
14
- code reduction: 20.19 %
14
+ code reduction: 19.14 %
15
15
  dependents: 1
16
16
  - /src/server.ts
17
17
 
18
18
  ███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
19
19
  file: /src/sources/RemoteSource.ts
20
- bundle space: 23.71 %
21
- rendered size: 1.199 KB
20
+ bundle space: 23.53 %
21
+ rendered size: 1.227 KB
22
22
  original size: 1.605 KB
23
- code reduction: 25.3 %
23
+ code reduction: 23.55 %
24
24
  dependents: 1
25
25
  - /src/server.ts
26
26
 
27
27
  ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
28
28
  file: /src/sources/AppSettingsSource.ts
29
- bundle space: 12.92 %
30
- rendered size: 653 Bytes
29
+ bundle space: 13.5 %
30
+ rendered size: 704 Bytes
31
31
  original size: 1.127 KB
32
- code reduction: 42.06 %
32
+ code reduction: 37.53 %
33
33
  dependents: 1
34
34
  - /src/server.ts
35
35
 
36
36
  ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
37
37
  file: /src/sources/helpers/loadJson.ts
38
- bundle space: 12.06 %
39
- rendered size: 610 Bytes
38
+ bundle space: 12 %
39
+ rendered size: 626 Bytes
40
40
  original size: 945 Bytes
41
- code reduction: 35.45 %
41
+ code reduction: 33.76 %
42
42
  dependents: 1
43
43
  - /src/sources/AppSettingsSource.ts
44
44
 
45
45
  ███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
46
46
  file: /src/config/createAppSettings.ts
47
- bundle space: 6.41 %
48
- rendered size: 324 Bytes
47
+ bundle space: 6.77 %
48
+ rendered size: 353 Bytes
49
49
  original size: 610 Bytes
50
- code reduction: 46.89 %
50
+ code reduction: 42.13 %
51
51
  dependents: 1
52
52
  - /src/server.ts
53
53
 
54
- ███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
54
+ ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
55
55
  file: /src/config/ConfigMerger.ts
56
- bundle space: 6.03 %
57
- rendered size: 305 Bytes
56
+ bundle space: 5.98 %
57
+ rendered size: 312 Bytes
58
58
  original size: 379 Bytes
59
- code reduction: 19.53 %
59
+ code reduction: 17.68 %
60
60
  dependents: 2
61
61
  - /src/config/createAppSettings.ts
62
62
  - /src/sources/AppSettingsSource.ts
63
63
 
64
64
  ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
65
65
  file: /src/sources/MemorySource.ts
66
- bundle space: 4.13 %
67
- rendered size: 209 Bytes
66
+ bundle space: 4.14 %
67
+ rendered size: 216 Bytes
68
68
  original size: 563 Bytes
69
- code reduction: 62.88 %
69
+ code reduction: 61.63 %
70
70
  dependents: 1
71
71
  - /src/server.ts
72
72
 
73
73
  █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
74
74
  file: /src/config/ConfigValidator.ts
75
- bundle space: 3.07 %
75
+ bundle space: 2.97 %
76
76
  rendered size: 155 Bytes
77
77
  original size: 272 Bytes
78
78
  code reduction: 43.01 %
@@ -0,0 +1,4 @@
1
+ import { type Get } from 'type-fest';
2
+ import { type SettingSectionPath } from '#types/Config.types.cts';
3
+ export declare const createUseAppSettings: <T extends object>() => <P extends SettingSectionPath<T>>(path: P) => Get<T, P> | undefined;
4
+ //# sourceMappingURL=createUseAppSettings.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUseAppSettings.d.cts","sourceRoot":"","sources":["../../../../src/hooks/createUseAppSettings.cts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,MAAM,QAC3C,CAAC,SAAS,kBAAkB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAMhE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type Get } from 'type-fest';
2
+ import { type SettingPath } from '#types/Config.types.cts';
3
+ export declare const createUseSetting: <T extends object>() => <P extends SettingPath<T>>(path: P) => Get<T, P> | undefined;
4
+ //# sourceMappingURL=createUseSetting.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUseSetting.d.cts","sourceRoot":"","sources":["../../../../src/hooks/createUseSetting.cts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,QACvC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAMzD,CAAC"}
@@ -1,10 +1,8 @@
1
1
  export { AppSettingsProvider } from '#components/AppSettingsProvider.ctsx';
2
2
  export { Setting } from '#components/Setting.ctsx';
3
- export { useAppSetting } from '#hooks/useAppSetting.cts';
4
- export { useAppSettings } from '#hooks/useAppSettings.cts';
3
+ export { createUseSetting } from '#hooks/createUseSetting.cts';
4
+ export { createUseAppSettings } from '#hooks/createUseAppSettings.cts';
5
5
  export { useAppSettingsContext } from '#hooks/useAppSettingsContext.cts';
6
6
  export type { AppSettings, ScopedSettings } from '#types/AppSettings.types.cts';
7
7
  export type { SettingPath, SettingSectionPath, SettingValue } from '#types/Config.types.cts';
8
- export interface AppSettingsSchema {
9
- }
10
8
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/index.cts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC/E,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI5F,MAAM,WAAW,iBAAiB;CAAG"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/index.cts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC/E,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type Get } from 'type-fest';
2
+ import { type SettingSectionPath } from '#types/Config.types.ts';
3
+ export declare const createUseAppSettings: <T extends object>() => <P extends SettingSectionPath<T>>(path: P) => Get<T, P> | undefined;
4
+ //# sourceMappingURL=createUseAppSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUseAppSettings.d.ts","sourceRoot":"","sources":["../../../../src/hooks/createUseAppSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,MAAM,QAC3C,CAAC,SAAS,kBAAkB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAMhE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type Get } from 'type-fest';
2
+ import { type SettingPath } from '#types/Config.types.ts';
3
+ export declare const createUseSetting: <T extends object>() => <P extends SettingPath<T>>(path: P) => Get<T, P> | undefined;
4
+ //# sourceMappingURL=createUseSetting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUseSetting.d.ts","sourceRoot":"","sources":["../../../../src/hooks/createUseSetting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,QACvC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAMzD,CAAC"}
@@ -1,10 +1,8 @@
1
1
  export { AppSettingsProvider } from '#components/AppSettingsProvider.tsx';
2
2
  export { Setting } from '#components/Setting.tsx';
3
- export { useAppSetting } from '#hooks/useAppSetting.ts';
4
- export { useAppSettings } from '#hooks/useAppSettings.ts';
3
+ export { createUseSetting } from '#hooks/createUseSetting.ts';
4
+ export { createUseAppSettings } from '#hooks/createUseAppSettings.ts';
5
5
  export { useAppSettingsContext } from '#hooks/useAppSettingsContext.ts';
6
6
  export type { AppSettings, ScopedSettings } from '#types/AppSettings.types.ts';
7
7
  export type { SettingPath, SettingSectionPath, SettingValue } from '#types/Config.types.ts';
8
- export interface AppSettingsSchema {
9
- }
10
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC/E,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI5F,MAAM,WAAW,iBAAiB;CAAG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC/E,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC"}