@donotdev/core 0.0.13 → 0.0.15
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/eslint/index.js +1 -1
- package/functions/index.d.ts +1083 -3
- package/functions/index.js +11 -1
- package/i18n/locales/eager/dndev_ar.json +0 -139
- package/i18n/locales/eager/dndev_de.json +0 -139
- package/i18n/locales/eager/dndev_en.json +5 -139
- package/i18n/locales/eager/dndev_es.json +0 -139
- package/i18n/locales/eager/dndev_fr.json +0 -139
- package/i18n/locales/eager/dndev_it.json +47 -186
- package/i18n/locales/eager/dndev_ja.json +0 -139
- package/i18n/locales/eager/dndev_ko.json +0 -139
- package/i18n/locales/lazy/crud_ar.json +195 -0
- package/i18n/locales/lazy/crud_de.json +195 -0
- package/i18n/locales/lazy/crud_en.json +412 -0
- package/i18n/locales/lazy/crud_es.json +195 -0
- package/i18n/locales/lazy/crud_fr.json +195 -0
- package/i18n/locales/lazy/crud_it.json +195 -0
- package/i18n/locales/lazy/crud_ja.json +195 -0
- package/i18n/locales/lazy/crud_ko.json +195 -0
- package/i18n/locales/lazy/oauth_ar.json +11 -11
- package/i18n/locales/lazy/oauth_de.json +11 -11
- package/i18n/locales/lazy/oauth_en.json +11 -11
- package/i18n/locales/lazy/oauth_es.json +11 -11
- package/i18n/locales/lazy/oauth_fr.json +11 -11
- package/i18n/locales/lazy/oauth_it.json +11 -11
- package/i18n/locales/lazy/oauth_ja.json +11 -11
- package/i18n/locales/lazy/oauth_ko.json +11 -11
- package/index.d.ts +6636 -6348
- package/index.js +37 -37
- package/next/index.d.ts +209 -154
- package/next/index.js +20 -20
- package/package.json +1 -1
- package/server.d.ts +4787 -3940
- package/server.js +1 -1
- package/vite/index.d.ts +209 -154
- package/vite/index.js +2 -2
package/vite/index.d.ts
CHANGED
|
@@ -759,160 +759,6 @@ declare global {
|
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
|
|
762
|
-
type $MergeBy<T, K> = Omit<T, keyof K> & K;
|
|
763
|
-
|
|
764
|
-
type $PreservedValue<Value, Fallback> = [Value] extends [never] ? Fallback : Value;
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* This interface can be augmented by users to add types to `i18next` default TypeOptions.
|
|
768
|
-
*
|
|
769
|
-
* Usage:
|
|
770
|
-
* ```ts
|
|
771
|
-
* // i18next.d.ts
|
|
772
|
-
* import 'i18next';
|
|
773
|
-
* declare module 'i18next' {
|
|
774
|
-
* interface CustomTypeOptions {
|
|
775
|
-
* defaultNS: 'custom';
|
|
776
|
-
* returnNull: false;
|
|
777
|
-
* returnObjects: false;
|
|
778
|
-
* nsSeparator: ':';
|
|
779
|
-
* keySeparator: '.';
|
|
780
|
-
* compatibilityJSON: 'v4';
|
|
781
|
-
* allowObjectInHTMLChildren: false;
|
|
782
|
-
* resources: {
|
|
783
|
-
* custom: {
|
|
784
|
-
* foo: 'foo';
|
|
785
|
-
* };
|
|
786
|
-
* };
|
|
787
|
-
* }
|
|
788
|
-
* }
|
|
789
|
-
* ```
|
|
790
|
-
*/
|
|
791
|
-
interface CustomTypeOptions {}
|
|
792
|
-
|
|
793
|
-
type TypeOptions = $MergeBy<
|
|
794
|
-
{
|
|
795
|
-
/** @see {InitOptions.returnNull} */
|
|
796
|
-
returnNull: false;
|
|
797
|
-
|
|
798
|
-
/** @see {InitOptions.returnEmptyString} */
|
|
799
|
-
returnEmptyString: true;
|
|
800
|
-
|
|
801
|
-
/** @see {InitOptions.returnObjects} */
|
|
802
|
-
returnObjects: false;
|
|
803
|
-
|
|
804
|
-
/** @see {InitOptions.keySeparator} */
|
|
805
|
-
keySeparator: '.';
|
|
806
|
-
|
|
807
|
-
/** @see {InitOptions.nsSeparator} */
|
|
808
|
-
nsSeparator: ':';
|
|
809
|
-
|
|
810
|
-
/** @see {InitOptions.pluralSeparator} */
|
|
811
|
-
pluralSeparator: '_';
|
|
812
|
-
|
|
813
|
-
/** @see {InitOptions.contextSeparator} */
|
|
814
|
-
contextSeparator: '_';
|
|
815
|
-
|
|
816
|
-
/** @see {InitOptions.defaultNS} */
|
|
817
|
-
defaultNS: 'translation';
|
|
818
|
-
|
|
819
|
-
/** @see {InitOptions.fallbackNS} */
|
|
820
|
-
fallbackNS: false;
|
|
821
|
-
|
|
822
|
-
/** @see {InitOptions.compatibilityJSON} */
|
|
823
|
-
compatibilityJSON: 'v4';
|
|
824
|
-
|
|
825
|
-
/** @see {InitOptions.resources} */
|
|
826
|
-
resources: object;
|
|
827
|
-
|
|
828
|
-
/**
|
|
829
|
-
* Flag that allows HTML elements to receive objects. This is only useful for React applications
|
|
830
|
-
* where you pass objects to HTML elements so they can be replaced to their respective interpolation
|
|
831
|
-
* values (mostly with Trans component)
|
|
832
|
-
*/
|
|
833
|
-
allowObjectInHTMLChildren: false;
|
|
834
|
-
|
|
835
|
-
/**
|
|
836
|
-
* Flag that enables strict key checking even if a `defaultValue` has been provided.
|
|
837
|
-
* This ensures all calls of `t` function don't accidentally use implicitly missing keys.
|
|
838
|
-
*/
|
|
839
|
-
strictKeyChecks: false;
|
|
840
|
-
|
|
841
|
-
/**
|
|
842
|
-
* Prefix for interpolation
|
|
843
|
-
*/
|
|
844
|
-
interpolationPrefix: '{{';
|
|
845
|
-
|
|
846
|
-
/**
|
|
847
|
-
* Suffix for interpolation
|
|
848
|
-
*/
|
|
849
|
-
interpolationSuffix: '}}';
|
|
850
|
-
|
|
851
|
-
/** @see {InterpolationOptions.unescapePrefix} */
|
|
852
|
-
unescapePrefix: '-';
|
|
853
|
-
|
|
854
|
-
/** @see {InterpolationOptions.unescapeSuffix} */
|
|
855
|
-
unescapeSuffix: '';
|
|
856
|
-
|
|
857
|
-
/**
|
|
858
|
-
* Use a proxy-based selector to select a translation.
|
|
859
|
-
*
|
|
860
|
-
* Enables features like go-to definition, and better DX/faster autocompletion
|
|
861
|
-
* for TypeScript developers.
|
|
862
|
-
*
|
|
863
|
-
* If you're working with an especially large set of translations and aren't
|
|
864
|
-
* using context, you set `enableSelector` to `"optimize"` and i18next won't do
|
|
865
|
-
* any type-level processing of your translations at all.
|
|
866
|
-
*
|
|
867
|
-
* With `enableSelector` set to `"optimize"`, i18next is capable of supporting
|
|
868
|
-
* arbitrarily large/deep translation sets without causing any IDE slowdown
|
|
869
|
-
* whatsoever.
|
|
870
|
-
*
|
|
871
|
-
* @default false
|
|
872
|
-
*/
|
|
873
|
-
enableSelector: false;
|
|
874
|
-
},
|
|
875
|
-
CustomTypeOptions
|
|
876
|
-
>;
|
|
877
|
-
|
|
878
|
-
type FlatNamespace = $PreservedValue<keyof TypeOptions['resources'], string>;
|
|
879
|
-
type Namespace<T = FlatNamespace> = T | readonly T[];
|
|
880
|
-
|
|
881
|
-
interface ReportNamespaces {
|
|
882
|
-
addUsedNamespaces(namespaces: Namespace): void;
|
|
883
|
-
getUsedNamespaces(): string[];
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
declare module 'i18next' {
|
|
887
|
-
// interface i18n {
|
|
888
|
-
// reportNamespaces?: ReportNamespaces;
|
|
889
|
-
// }
|
|
890
|
-
interface CustomInstanceExtensions {
|
|
891
|
-
reportNamespaces?: ReportNamespaces;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true
|
|
896
|
-
? Record<string, unknown>
|
|
897
|
-
: never;
|
|
898
|
-
|
|
899
|
-
type ReactI18NextChildren = React.ReactNode | ObjectOrNever;
|
|
900
|
-
|
|
901
|
-
declare module 'react' {
|
|
902
|
-
namespace JSX {
|
|
903
|
-
interface IntrinsicAttributes {
|
|
904
|
-
i18nIsDynamicList?: boolean;
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
interface HTMLAttributes<T> {
|
|
909
|
-
// This union is inspired by the typings for React.ReactNode. We do this to fix "This JSX tag's 'children' prop
|
|
910
|
-
// expects a single child of type 'ReactI18NextChildren', but multiple children were provided":
|
|
911
|
-
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5a1e9f91ed0143adede394adb3f540e650455f71/types/react/index.d.ts#L268
|
|
912
|
-
children?: ReactI18NextChildren | Iterable<ReactI18NextChildren>;
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
|
|
916
762
|
// packages/core/types/src/layout/layoutTypes.ts
|
|
917
763
|
|
|
918
764
|
|
|
@@ -1226,6 +1072,59 @@ interface FeaturesConfig {
|
|
|
1226
1072
|
* @since 0.0.1
|
|
1227
1073
|
* @author AMBROISE PARK Consulting
|
|
1228
1074
|
*/
|
|
1075
|
+
/**
|
|
1076
|
+
* Query cache configuration
|
|
1077
|
+
*
|
|
1078
|
+
* Configure default TanStack Query cache behavior for your app.
|
|
1079
|
+
* These settings apply to all queries unless overridden per-query.
|
|
1080
|
+
*
|
|
1081
|
+
* **Framework Defaults (Infinite Cache):**
|
|
1082
|
+
* - `staleTime: Infinity` (data never becomes stale)
|
|
1083
|
+
* - `refetchOnWindowFocus: false` (manual refresh only)
|
|
1084
|
+
* - `refetchOnReconnect: false` (manual refresh only)
|
|
1085
|
+
*
|
|
1086
|
+
* This default strategy minimizes API costs and is ideal for:
|
|
1087
|
+
* - Single-admin apps
|
|
1088
|
+
* - Apps with manual refresh buttons
|
|
1089
|
+
* - Cost-optimized scenarios
|
|
1090
|
+
*
|
|
1091
|
+
* @example
|
|
1092
|
+
* ```typescript
|
|
1093
|
+
* // Use framework defaults (infinite cache, no auto-refetch)
|
|
1094
|
+
* // No query config needed - defaults are optimal
|
|
1095
|
+
* ```
|
|
1096
|
+
*
|
|
1097
|
+
* @example
|
|
1098
|
+
* ```typescript
|
|
1099
|
+
* // Override to short cache with auto-refetch
|
|
1100
|
+
* query: {
|
|
1101
|
+
* staleTime: 1000 * 60 * 5, // 5 minutes
|
|
1102
|
+
* refetchOnWindowFocus: true,
|
|
1103
|
+
* refetchOnReconnect: true,
|
|
1104
|
+
* }
|
|
1105
|
+
* ```
|
|
1106
|
+
*
|
|
1107
|
+
* @version 0.0.1
|
|
1108
|
+
* @since 0.0.1
|
|
1109
|
+
* @author AMBROISE PARK Consulting
|
|
1110
|
+
*/
|
|
1111
|
+
interface QueryConfig {
|
|
1112
|
+
/** Time until data is considered stale (default: Infinity = never stale) */
|
|
1113
|
+
staleTime?: number;
|
|
1114
|
+
/** Time until inactive data is garbage collected (default: 30 minutes) */
|
|
1115
|
+
gcTime?: number;
|
|
1116
|
+
/** Number of retry attempts for failed queries (default: 1) */
|
|
1117
|
+
retry?: number;
|
|
1118
|
+
/** Whether to refetch when window regains focus (default: false = manual refresh only) */
|
|
1119
|
+
refetchOnWindowFocus?: boolean;
|
|
1120
|
+
/** Whether to refetch on reconnect (default: false = manual refresh only) */
|
|
1121
|
+
refetchOnReconnect?: boolean;
|
|
1122
|
+
/** Mutation retry attempts (default: 1) */
|
|
1123
|
+
mutationRetry?: number;
|
|
1124
|
+
/** Mutation retry delay function (default: exponential backoff) */
|
|
1125
|
+
mutationRetryDelay?: (attemptIndex: number) => number;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1229
1128
|
interface AppConfig {
|
|
1230
1129
|
/** App metadata and branding */
|
|
1231
1130
|
app?: AppMetadata;
|
|
@@ -1239,6 +1138,162 @@ interface AppConfig {
|
|
|
1239
1138
|
preset?: string;
|
|
1240
1139
|
/** Feature flags */
|
|
1241
1140
|
features?: FeaturesConfig;
|
|
1141
|
+
/** Query cache configuration (defaults: 5min staleTime, refetch on focus/reconnect) */
|
|
1142
|
+
query?: QueryConfig;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
type $MergeBy<T, K> = Omit<T, keyof K> & K;
|
|
1146
|
+
|
|
1147
|
+
type $PreservedValue<Value, Fallback> = [Value] extends [never] ? Fallback : Value;
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* This interface can be augmented by users to add types to `i18next` default TypeOptions.
|
|
1151
|
+
*
|
|
1152
|
+
* Usage:
|
|
1153
|
+
* ```ts
|
|
1154
|
+
* // i18next.d.ts
|
|
1155
|
+
* import 'i18next';
|
|
1156
|
+
* declare module 'i18next' {
|
|
1157
|
+
* interface CustomTypeOptions {
|
|
1158
|
+
* defaultNS: 'custom';
|
|
1159
|
+
* returnNull: false;
|
|
1160
|
+
* returnObjects: false;
|
|
1161
|
+
* nsSeparator: ':';
|
|
1162
|
+
* keySeparator: '.';
|
|
1163
|
+
* compatibilityJSON: 'v4';
|
|
1164
|
+
* allowObjectInHTMLChildren: false;
|
|
1165
|
+
* resources: {
|
|
1166
|
+
* custom: {
|
|
1167
|
+
* foo: 'foo';
|
|
1168
|
+
* };
|
|
1169
|
+
* };
|
|
1170
|
+
* }
|
|
1171
|
+
* }
|
|
1172
|
+
* ```
|
|
1173
|
+
*/
|
|
1174
|
+
interface CustomTypeOptions {}
|
|
1175
|
+
|
|
1176
|
+
type TypeOptions = $MergeBy<
|
|
1177
|
+
{
|
|
1178
|
+
/** @see {InitOptions.returnNull} */
|
|
1179
|
+
returnNull: false;
|
|
1180
|
+
|
|
1181
|
+
/** @see {InitOptions.returnEmptyString} */
|
|
1182
|
+
returnEmptyString: true;
|
|
1183
|
+
|
|
1184
|
+
/** @see {InitOptions.returnObjects} */
|
|
1185
|
+
returnObjects: false;
|
|
1186
|
+
|
|
1187
|
+
/** @see {InitOptions.keySeparator} */
|
|
1188
|
+
keySeparator: '.';
|
|
1189
|
+
|
|
1190
|
+
/** @see {InitOptions.nsSeparator} */
|
|
1191
|
+
nsSeparator: ':';
|
|
1192
|
+
|
|
1193
|
+
/** @see {InitOptions.pluralSeparator} */
|
|
1194
|
+
pluralSeparator: '_';
|
|
1195
|
+
|
|
1196
|
+
/** @see {InitOptions.contextSeparator} */
|
|
1197
|
+
contextSeparator: '_';
|
|
1198
|
+
|
|
1199
|
+
/** @see {InitOptions.defaultNS} */
|
|
1200
|
+
defaultNS: 'translation';
|
|
1201
|
+
|
|
1202
|
+
/** @see {InitOptions.fallbackNS} */
|
|
1203
|
+
fallbackNS: false;
|
|
1204
|
+
|
|
1205
|
+
/** @see {InitOptions.compatibilityJSON} */
|
|
1206
|
+
compatibilityJSON: 'v4';
|
|
1207
|
+
|
|
1208
|
+
/** @see {InitOptions.resources} */
|
|
1209
|
+
resources: object;
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Flag that allows HTML elements to receive objects. This is only useful for React applications
|
|
1213
|
+
* where you pass objects to HTML elements so they can be replaced to their respective interpolation
|
|
1214
|
+
* values (mostly with Trans component)
|
|
1215
|
+
*/
|
|
1216
|
+
allowObjectInHTMLChildren: false;
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Flag that enables strict key checking even if a `defaultValue` has been provided.
|
|
1220
|
+
* This ensures all calls of `t` function don't accidentally use implicitly missing keys.
|
|
1221
|
+
*/
|
|
1222
|
+
strictKeyChecks: false;
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Prefix for interpolation
|
|
1226
|
+
*/
|
|
1227
|
+
interpolationPrefix: '{{';
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* Suffix for interpolation
|
|
1231
|
+
*/
|
|
1232
|
+
interpolationSuffix: '}}';
|
|
1233
|
+
|
|
1234
|
+
/** @see {InterpolationOptions.unescapePrefix} */
|
|
1235
|
+
unescapePrefix: '-';
|
|
1236
|
+
|
|
1237
|
+
/** @see {InterpolationOptions.unescapeSuffix} */
|
|
1238
|
+
unescapeSuffix: '';
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* Use a proxy-based selector to select a translation.
|
|
1242
|
+
*
|
|
1243
|
+
* Enables features like go-to definition, and better DX/faster autocompletion
|
|
1244
|
+
* for TypeScript developers.
|
|
1245
|
+
*
|
|
1246
|
+
* If you're working with an especially large set of translations and aren't
|
|
1247
|
+
* using context, you set `enableSelector` to `"optimize"` and i18next won't do
|
|
1248
|
+
* any type-level processing of your translations at all.
|
|
1249
|
+
*
|
|
1250
|
+
* With `enableSelector` set to `"optimize"`, i18next is capable of supporting
|
|
1251
|
+
* arbitrarily large/deep translation sets without causing any IDE slowdown
|
|
1252
|
+
* whatsoever.
|
|
1253
|
+
*
|
|
1254
|
+
* @default false
|
|
1255
|
+
*/
|
|
1256
|
+
enableSelector: false;
|
|
1257
|
+
},
|
|
1258
|
+
CustomTypeOptions
|
|
1259
|
+
>;
|
|
1260
|
+
|
|
1261
|
+
type FlatNamespace = $PreservedValue<keyof TypeOptions['resources'], string>;
|
|
1262
|
+
type Namespace<T = FlatNamespace> = T | readonly T[];
|
|
1263
|
+
|
|
1264
|
+
interface ReportNamespaces {
|
|
1265
|
+
addUsedNamespaces(namespaces: Namespace): void;
|
|
1266
|
+
getUsedNamespaces(): string[];
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
declare module 'i18next' {
|
|
1270
|
+
// interface i18n {
|
|
1271
|
+
// reportNamespaces?: ReportNamespaces;
|
|
1272
|
+
// }
|
|
1273
|
+
interface CustomInstanceExtensions {
|
|
1274
|
+
reportNamespaces?: ReportNamespaces;
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true
|
|
1279
|
+
? Record<string, unknown>
|
|
1280
|
+
: never;
|
|
1281
|
+
|
|
1282
|
+
type ReactI18NextChildren = React.ReactNode | ObjectOrNever;
|
|
1283
|
+
|
|
1284
|
+
declare module 'react' {
|
|
1285
|
+
namespace JSX {
|
|
1286
|
+
interface IntrinsicAttributes {
|
|
1287
|
+
i18nIsDynamicList?: boolean;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
interface HTMLAttributes<T> {
|
|
1292
|
+
// This union is inspired by the typings for React.ReactNode. We do this to fix "This JSX tag's 'children' prop
|
|
1293
|
+
// expects a single child of type 'ReactI18NextChildren', but multiple children were provided":
|
|
1294
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5a1e9f91ed0143adede394adb3f540e650455f71/types/react/index.d.ts#L268
|
|
1295
|
+
children?: ReactI18NextChildren | Iterable<ReactI18NextChildren>;
|
|
1296
|
+
}
|
|
1242
1297
|
}
|
|
1243
1298
|
|
|
1244
1299
|
// packages/core/config/index.d.ts
|