idea-manager 1.3.9 → 1.3.10

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 (84) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +8 -8
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/server/app/_global-error.html +2 -2
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found.html +2 -2
  13. package/.next/server/app/_not-found.rsc +1 -1
  14. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  20. package/.next/server/app/index.html +2 -2
  21. package/.next/server/app/index.rsc +1 -1
  22. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  23. package/.next/server/app/index.segments/_full.segment.rsc +1 -1
  24. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  25. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  26. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  27. package/.next/server/app-paths-manifest.json +8 -8
  28. package/.next/server/pages/404.html +2 -2
  29. package/.next/server/pages/500.html +2 -2
  30. package/package.json +6 -1
  31. package/.next/diagnostics/build-diagnostics.json +0 -6
  32. package/.next/diagnostics/framework.json +0 -1
  33. package/.next/next-minimal-server.js.nft.json +0 -1
  34. package/.next/next-server.js.nft.json +0 -1
  35. package/.next/server/app/_global-error/page.js.nft.json +0 -1
  36. package/.next/server/app/_not-found/page.js.nft.json +0 -1
  37. package/.next/server/app/api/archive/route.js.nft.json +0 -1
  38. package/.next/server/app/api/filesystem/route.js.nft.json +0 -1
  39. package/.next/server/app/api/filesystem/tree/route.js.nft.json +0 -1
  40. package/.next/server/app/api/global-memo/route.js.nft.json +0 -1
  41. package/.next/server/app/api/health/route.js.nft.json +0 -1
  42. package/.next/server/app/api/projects/[id]/apply-distribute/route.js.nft.json +0 -1
  43. package/.next/server/app/api/projects/[id]/auto-distribute/route.js.nft.json +0 -1
  44. package/.next/server/app/api/projects/[id]/brainstorm/route.js.nft.json +0 -1
  45. package/.next/server/app/api/projects/[id]/git-sync/route.js.nft.json +0 -1
  46. package/.next/server/app/api/projects/[id]/route.js.nft.json +0 -1
  47. package/.next/server/app/api/projects/[id]/sub-projects/[subId]/route.js.nft.json +0 -1
  48. package/.next/server/app/api/projects/[id]/sub-projects/[subId]/tasks/[taskId]/chat/route.js.nft.json +0 -1
  49. package/.next/server/app/api/projects/[id]/sub-projects/[subId]/tasks/[taskId]/prompt/route.js.nft.json +0 -1
  50. package/.next/server/app/api/projects/[id]/sub-projects/[subId]/tasks/[taskId]/route.js.nft.json +0 -1
  51. package/.next/server/app/api/projects/[id]/sub-projects/[subId]/tasks/route.js.nft.json +0 -1
  52. package/.next/server/app/api/projects/[id]/sub-projects/route.js.nft.json +0 -1
  53. package/.next/server/app/api/projects/route.js.nft.json +0 -1
  54. package/.next/server/app/api/sync/route.js.nft.json +0 -1
  55. package/.next/server/app/page.js.nft.json +0 -1
  56. package/.next/server/app/projects/[id]/page.js.nft.json +0 -1
  57. package/.next/trace +0 -3
  58. package/.next/trace-build +0 -1
  59. package/.next/types/app/api/archive/route.ts +0 -350
  60. package/.next/types/app/api/filesystem/route.ts +0 -350
  61. package/.next/types/app/api/filesystem/tree/route.ts +0 -350
  62. package/.next/types/app/api/global-memo/route.ts +0 -350
  63. package/.next/types/app/api/health/route.ts +0 -350
  64. package/.next/types/app/api/projects/[id]/apply-distribute/route.ts +0 -350
  65. package/.next/types/app/api/projects/[id]/auto-distribute/route.ts +0 -350
  66. package/.next/types/app/api/projects/[id]/brainstorm/route.ts +0 -350
  67. package/.next/types/app/api/projects/[id]/git-sync/route.ts +0 -350
  68. package/.next/types/app/api/projects/[id]/route.ts +0 -350
  69. package/.next/types/app/api/projects/[id]/sub-projects/[subId]/route.ts +0 -350
  70. package/.next/types/app/api/projects/[id]/sub-projects/[subId]/tasks/[taskId]/chat/route.ts +0 -350
  71. package/.next/types/app/api/projects/[id]/sub-projects/[subId]/tasks/[taskId]/prompt/route.ts +0 -350
  72. package/.next/types/app/api/projects/[id]/sub-projects/[subId]/tasks/[taskId]/route.ts +0 -350
  73. package/.next/types/app/api/projects/[id]/sub-projects/[subId]/tasks/route.ts +0 -350
  74. package/.next/types/app/api/projects/[id]/sub-projects/route.ts +0 -350
  75. package/.next/types/app/api/projects/route.ts +0 -350
  76. package/.next/types/app/api/sync/route.ts +0 -350
  77. package/.next/types/app/layout.ts +0 -86
  78. package/.next/types/app/page.ts +0 -86
  79. package/.next/types/app/projects/[id]/page.ts +0 -86
  80. package/.next/types/package.json +0 -1
  81. package/.next/types/routes.d.ts +0 -91
  82. package/.next/types/validator.ts +0 -241
  83. /package/.next/static/{sIFkASD_IYJKljh8Eq7vu → B4yGuDt7zYUWMKo6u_qwJ}/_buildManifest.js +0 -0
  84. /package/.next/static/{sIFkASD_IYJKljh8Eq7vu → B4yGuDt7zYUWMKo6u_qwJ}/_ssgManifest.js +0 -0
@@ -1,350 +0,0 @@
1
- // File: /Users/young/Toy/idea-manager/src/app/api/projects/[id]/auto-distribute/route.ts
2
- import * as entry from '../../../../../../../src/app/api/projects/[id]/auto-distribute/route.js'
3
- import type { NextRequest } from 'next/server.js'
4
-
5
- import type { PrefetchForTypeCheckInternal } from 'next/dist/build/segment-config/app/app-segment-config.js'
6
-
7
- type TEntry = typeof import('../../../../../../../src/app/api/projects/[id]/auto-distribute/route.js')
8
-
9
- type SegmentParams<T extends Object = any> = T extends Record<string, any>
10
- ? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
11
- : T
12
-
13
- // Check that the entry is a valid entry
14
- checkFields<Diff<{
15
- GET?: Function
16
- HEAD?: Function
17
- OPTIONS?: Function
18
- POST?: Function
19
- PUT?: Function
20
- DELETE?: Function
21
- PATCH?: Function
22
- config?: {}
23
- generateStaticParams?: Function
24
- unstable_prefetch?: PrefetchForTypeCheckInternal
25
- revalidate?: RevalidateRange<TEntry> | false
26
- dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
27
- dynamicParams?: boolean
28
- fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
29
- preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
30
- runtime?: 'nodejs' | 'experimental-edge' | 'edge'
31
- maxDuration?: number
32
-
33
- }, TEntry, ''>>()
34
-
35
- type RouteContext = { params: Promise<SegmentParams> }
36
- // Check the prop type of the entry function
37
- if ('GET' in entry) {
38
- checkFields<
39
- Diff<
40
- ParamCheck<Request | NextRequest>,
41
- {
42
- __tag__: 'GET'
43
- __param_position__: 'first'
44
- __param_type__: FirstArg<MaybeField<TEntry, 'GET'>>
45
- },
46
- 'GET'
47
- >
48
- >()
49
- checkFields<
50
- Diff<
51
- ParamCheck<RouteContext>,
52
- {
53
- __tag__: 'GET'
54
- __param_position__: 'second'
55
- __param_type__: SecondArg<MaybeField<TEntry, 'GET'>>
56
- },
57
- 'GET'
58
- >
59
- >()
60
-
61
- checkFields<
62
- Diff<
63
- {
64
- __tag__: 'GET',
65
- __return_type__: Response | void | never | Promise<Response | void | never>
66
- },
67
- {
68
- __tag__: 'GET',
69
- __return_type__: ReturnType<MaybeField<TEntry, 'GET'>>
70
- },
71
- 'GET'
72
- >
73
- >()
74
- }
75
- // Check the prop type of the entry function
76
- if ('HEAD' in entry) {
77
- checkFields<
78
- Diff<
79
- ParamCheck<Request | NextRequest>,
80
- {
81
- __tag__: 'HEAD'
82
- __param_position__: 'first'
83
- __param_type__: FirstArg<MaybeField<TEntry, 'HEAD'>>
84
- },
85
- 'HEAD'
86
- >
87
- >()
88
- checkFields<
89
- Diff<
90
- ParamCheck<RouteContext>,
91
- {
92
- __tag__: 'HEAD'
93
- __param_position__: 'second'
94
- __param_type__: SecondArg<MaybeField<TEntry, 'HEAD'>>
95
- },
96
- 'HEAD'
97
- >
98
- >()
99
-
100
- checkFields<
101
- Diff<
102
- {
103
- __tag__: 'HEAD',
104
- __return_type__: Response | void | never | Promise<Response | void | never>
105
- },
106
- {
107
- __tag__: 'HEAD',
108
- __return_type__: ReturnType<MaybeField<TEntry, 'HEAD'>>
109
- },
110
- 'HEAD'
111
- >
112
- >()
113
- }
114
- // Check the prop type of the entry function
115
- if ('OPTIONS' in entry) {
116
- checkFields<
117
- Diff<
118
- ParamCheck<Request | NextRequest>,
119
- {
120
- __tag__: 'OPTIONS'
121
- __param_position__: 'first'
122
- __param_type__: FirstArg<MaybeField<TEntry, 'OPTIONS'>>
123
- },
124
- 'OPTIONS'
125
- >
126
- >()
127
- checkFields<
128
- Diff<
129
- ParamCheck<RouteContext>,
130
- {
131
- __tag__: 'OPTIONS'
132
- __param_position__: 'second'
133
- __param_type__: SecondArg<MaybeField<TEntry, 'OPTIONS'>>
134
- },
135
- 'OPTIONS'
136
- >
137
- >()
138
-
139
- checkFields<
140
- Diff<
141
- {
142
- __tag__: 'OPTIONS',
143
- __return_type__: Response | void | never | Promise<Response | void | never>
144
- },
145
- {
146
- __tag__: 'OPTIONS',
147
- __return_type__: ReturnType<MaybeField<TEntry, 'OPTIONS'>>
148
- },
149
- 'OPTIONS'
150
- >
151
- >()
152
- }
153
- // Check the prop type of the entry function
154
- if ('POST' in entry) {
155
- checkFields<
156
- Diff<
157
- ParamCheck<Request | NextRequest>,
158
- {
159
- __tag__: 'POST'
160
- __param_position__: 'first'
161
- __param_type__: FirstArg<MaybeField<TEntry, 'POST'>>
162
- },
163
- 'POST'
164
- >
165
- >()
166
- checkFields<
167
- Diff<
168
- ParamCheck<RouteContext>,
169
- {
170
- __tag__: 'POST'
171
- __param_position__: 'second'
172
- __param_type__: SecondArg<MaybeField<TEntry, 'POST'>>
173
- },
174
- 'POST'
175
- >
176
- >()
177
-
178
- checkFields<
179
- Diff<
180
- {
181
- __tag__: 'POST',
182
- __return_type__: Response | void | never | Promise<Response | void | never>
183
- },
184
- {
185
- __tag__: 'POST',
186
- __return_type__: ReturnType<MaybeField<TEntry, 'POST'>>
187
- },
188
- 'POST'
189
- >
190
- >()
191
- }
192
- // Check the prop type of the entry function
193
- if ('PUT' in entry) {
194
- checkFields<
195
- Diff<
196
- ParamCheck<Request | NextRequest>,
197
- {
198
- __tag__: 'PUT'
199
- __param_position__: 'first'
200
- __param_type__: FirstArg<MaybeField<TEntry, 'PUT'>>
201
- },
202
- 'PUT'
203
- >
204
- >()
205
- checkFields<
206
- Diff<
207
- ParamCheck<RouteContext>,
208
- {
209
- __tag__: 'PUT'
210
- __param_position__: 'second'
211
- __param_type__: SecondArg<MaybeField<TEntry, 'PUT'>>
212
- },
213
- 'PUT'
214
- >
215
- >()
216
-
217
- checkFields<
218
- Diff<
219
- {
220
- __tag__: 'PUT',
221
- __return_type__: Response | void | never | Promise<Response | void | never>
222
- },
223
- {
224
- __tag__: 'PUT',
225
- __return_type__: ReturnType<MaybeField<TEntry, 'PUT'>>
226
- },
227
- 'PUT'
228
- >
229
- >()
230
- }
231
- // Check the prop type of the entry function
232
- if ('DELETE' in entry) {
233
- checkFields<
234
- Diff<
235
- ParamCheck<Request | NextRequest>,
236
- {
237
- __tag__: 'DELETE'
238
- __param_position__: 'first'
239
- __param_type__: FirstArg<MaybeField<TEntry, 'DELETE'>>
240
- },
241
- 'DELETE'
242
- >
243
- >()
244
- checkFields<
245
- Diff<
246
- ParamCheck<RouteContext>,
247
- {
248
- __tag__: 'DELETE'
249
- __param_position__: 'second'
250
- __param_type__: SecondArg<MaybeField<TEntry, 'DELETE'>>
251
- },
252
- 'DELETE'
253
- >
254
- >()
255
-
256
- checkFields<
257
- Diff<
258
- {
259
- __tag__: 'DELETE',
260
- __return_type__: Response | void | never | Promise<Response | void | never>
261
- },
262
- {
263
- __tag__: 'DELETE',
264
- __return_type__: ReturnType<MaybeField<TEntry, 'DELETE'>>
265
- },
266
- 'DELETE'
267
- >
268
- >()
269
- }
270
- // Check the prop type of the entry function
271
- if ('PATCH' in entry) {
272
- checkFields<
273
- Diff<
274
- ParamCheck<Request | NextRequest>,
275
- {
276
- __tag__: 'PATCH'
277
- __param_position__: 'first'
278
- __param_type__: FirstArg<MaybeField<TEntry, 'PATCH'>>
279
- },
280
- 'PATCH'
281
- >
282
- >()
283
- checkFields<
284
- Diff<
285
- ParamCheck<RouteContext>,
286
- {
287
- __tag__: 'PATCH'
288
- __param_position__: 'second'
289
- __param_type__: SecondArg<MaybeField<TEntry, 'PATCH'>>
290
- },
291
- 'PATCH'
292
- >
293
- >()
294
-
295
- checkFields<
296
- Diff<
297
- {
298
- __tag__: 'PATCH',
299
- __return_type__: Response | void | never | Promise<Response | void | never>
300
- },
301
- {
302
- __tag__: 'PATCH',
303
- __return_type__: ReturnType<MaybeField<TEntry, 'PATCH'>>
304
- },
305
- 'PATCH'
306
- >
307
- >()
308
- }
309
-
310
- // Check the arguments and return type of the generateStaticParams function
311
- if ('generateStaticParams' in entry) {
312
- checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
313
- checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
314
- }
315
-
316
- export interface PageProps {
317
- params?: Promise<SegmentParams>
318
- searchParams?: Promise<any>
319
- }
320
- export interface LayoutProps {
321
- children?: React.ReactNode
322
-
323
- params?: Promise<SegmentParams>
324
- }
325
-
326
- // =============
327
- // Utility types
328
- type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
329
-
330
- // If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
331
- type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
332
- type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
333
-
334
- type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
335
- type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
336
- type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
337
-
338
- type ParamCheck<T> = {
339
- __tag__: string
340
- __param_position__: string
341
- __param_type__: T
342
- }
343
-
344
- function checkFields<_ extends { [k in keyof any]: never }>() {}
345
-
346
- // https://github.com/sindresorhus/type-fest
347
- type Numeric = number | bigint
348
- type Zero = 0 | 0n
349
- type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
350
- type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'
@@ -1,350 +0,0 @@
1
- // File: /Users/young/Toy/idea-manager/src/app/api/projects/[id]/brainstorm/route.ts
2
- import * as entry from '../../../../../../../src/app/api/projects/[id]/brainstorm/route.js'
3
- import type { NextRequest } from 'next/server.js'
4
-
5
- import type { PrefetchForTypeCheckInternal } from 'next/dist/build/segment-config/app/app-segment-config.js'
6
-
7
- type TEntry = typeof import('../../../../../../../src/app/api/projects/[id]/brainstorm/route.js')
8
-
9
- type SegmentParams<T extends Object = any> = T extends Record<string, any>
10
- ? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
11
- : T
12
-
13
- // Check that the entry is a valid entry
14
- checkFields<Diff<{
15
- GET?: Function
16
- HEAD?: Function
17
- OPTIONS?: Function
18
- POST?: Function
19
- PUT?: Function
20
- DELETE?: Function
21
- PATCH?: Function
22
- config?: {}
23
- generateStaticParams?: Function
24
- unstable_prefetch?: PrefetchForTypeCheckInternal
25
- revalidate?: RevalidateRange<TEntry> | false
26
- dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
27
- dynamicParams?: boolean
28
- fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
29
- preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
30
- runtime?: 'nodejs' | 'experimental-edge' | 'edge'
31
- maxDuration?: number
32
-
33
- }, TEntry, ''>>()
34
-
35
- type RouteContext = { params: Promise<SegmentParams> }
36
- // Check the prop type of the entry function
37
- if ('GET' in entry) {
38
- checkFields<
39
- Diff<
40
- ParamCheck<Request | NextRequest>,
41
- {
42
- __tag__: 'GET'
43
- __param_position__: 'first'
44
- __param_type__: FirstArg<MaybeField<TEntry, 'GET'>>
45
- },
46
- 'GET'
47
- >
48
- >()
49
- checkFields<
50
- Diff<
51
- ParamCheck<RouteContext>,
52
- {
53
- __tag__: 'GET'
54
- __param_position__: 'second'
55
- __param_type__: SecondArg<MaybeField<TEntry, 'GET'>>
56
- },
57
- 'GET'
58
- >
59
- >()
60
-
61
- checkFields<
62
- Diff<
63
- {
64
- __tag__: 'GET',
65
- __return_type__: Response | void | never | Promise<Response | void | never>
66
- },
67
- {
68
- __tag__: 'GET',
69
- __return_type__: ReturnType<MaybeField<TEntry, 'GET'>>
70
- },
71
- 'GET'
72
- >
73
- >()
74
- }
75
- // Check the prop type of the entry function
76
- if ('HEAD' in entry) {
77
- checkFields<
78
- Diff<
79
- ParamCheck<Request | NextRequest>,
80
- {
81
- __tag__: 'HEAD'
82
- __param_position__: 'first'
83
- __param_type__: FirstArg<MaybeField<TEntry, 'HEAD'>>
84
- },
85
- 'HEAD'
86
- >
87
- >()
88
- checkFields<
89
- Diff<
90
- ParamCheck<RouteContext>,
91
- {
92
- __tag__: 'HEAD'
93
- __param_position__: 'second'
94
- __param_type__: SecondArg<MaybeField<TEntry, 'HEAD'>>
95
- },
96
- 'HEAD'
97
- >
98
- >()
99
-
100
- checkFields<
101
- Diff<
102
- {
103
- __tag__: 'HEAD',
104
- __return_type__: Response | void | never | Promise<Response | void | never>
105
- },
106
- {
107
- __tag__: 'HEAD',
108
- __return_type__: ReturnType<MaybeField<TEntry, 'HEAD'>>
109
- },
110
- 'HEAD'
111
- >
112
- >()
113
- }
114
- // Check the prop type of the entry function
115
- if ('OPTIONS' in entry) {
116
- checkFields<
117
- Diff<
118
- ParamCheck<Request | NextRequest>,
119
- {
120
- __tag__: 'OPTIONS'
121
- __param_position__: 'first'
122
- __param_type__: FirstArg<MaybeField<TEntry, 'OPTIONS'>>
123
- },
124
- 'OPTIONS'
125
- >
126
- >()
127
- checkFields<
128
- Diff<
129
- ParamCheck<RouteContext>,
130
- {
131
- __tag__: 'OPTIONS'
132
- __param_position__: 'second'
133
- __param_type__: SecondArg<MaybeField<TEntry, 'OPTIONS'>>
134
- },
135
- 'OPTIONS'
136
- >
137
- >()
138
-
139
- checkFields<
140
- Diff<
141
- {
142
- __tag__: 'OPTIONS',
143
- __return_type__: Response | void | never | Promise<Response | void | never>
144
- },
145
- {
146
- __tag__: 'OPTIONS',
147
- __return_type__: ReturnType<MaybeField<TEntry, 'OPTIONS'>>
148
- },
149
- 'OPTIONS'
150
- >
151
- >()
152
- }
153
- // Check the prop type of the entry function
154
- if ('POST' in entry) {
155
- checkFields<
156
- Diff<
157
- ParamCheck<Request | NextRequest>,
158
- {
159
- __tag__: 'POST'
160
- __param_position__: 'first'
161
- __param_type__: FirstArg<MaybeField<TEntry, 'POST'>>
162
- },
163
- 'POST'
164
- >
165
- >()
166
- checkFields<
167
- Diff<
168
- ParamCheck<RouteContext>,
169
- {
170
- __tag__: 'POST'
171
- __param_position__: 'second'
172
- __param_type__: SecondArg<MaybeField<TEntry, 'POST'>>
173
- },
174
- 'POST'
175
- >
176
- >()
177
-
178
- checkFields<
179
- Diff<
180
- {
181
- __tag__: 'POST',
182
- __return_type__: Response | void | never | Promise<Response | void | never>
183
- },
184
- {
185
- __tag__: 'POST',
186
- __return_type__: ReturnType<MaybeField<TEntry, 'POST'>>
187
- },
188
- 'POST'
189
- >
190
- >()
191
- }
192
- // Check the prop type of the entry function
193
- if ('PUT' in entry) {
194
- checkFields<
195
- Diff<
196
- ParamCheck<Request | NextRequest>,
197
- {
198
- __tag__: 'PUT'
199
- __param_position__: 'first'
200
- __param_type__: FirstArg<MaybeField<TEntry, 'PUT'>>
201
- },
202
- 'PUT'
203
- >
204
- >()
205
- checkFields<
206
- Diff<
207
- ParamCheck<RouteContext>,
208
- {
209
- __tag__: 'PUT'
210
- __param_position__: 'second'
211
- __param_type__: SecondArg<MaybeField<TEntry, 'PUT'>>
212
- },
213
- 'PUT'
214
- >
215
- >()
216
-
217
- checkFields<
218
- Diff<
219
- {
220
- __tag__: 'PUT',
221
- __return_type__: Response | void | never | Promise<Response | void | never>
222
- },
223
- {
224
- __tag__: 'PUT',
225
- __return_type__: ReturnType<MaybeField<TEntry, 'PUT'>>
226
- },
227
- 'PUT'
228
- >
229
- >()
230
- }
231
- // Check the prop type of the entry function
232
- if ('DELETE' in entry) {
233
- checkFields<
234
- Diff<
235
- ParamCheck<Request | NextRequest>,
236
- {
237
- __tag__: 'DELETE'
238
- __param_position__: 'first'
239
- __param_type__: FirstArg<MaybeField<TEntry, 'DELETE'>>
240
- },
241
- 'DELETE'
242
- >
243
- >()
244
- checkFields<
245
- Diff<
246
- ParamCheck<RouteContext>,
247
- {
248
- __tag__: 'DELETE'
249
- __param_position__: 'second'
250
- __param_type__: SecondArg<MaybeField<TEntry, 'DELETE'>>
251
- },
252
- 'DELETE'
253
- >
254
- >()
255
-
256
- checkFields<
257
- Diff<
258
- {
259
- __tag__: 'DELETE',
260
- __return_type__: Response | void | never | Promise<Response | void | never>
261
- },
262
- {
263
- __tag__: 'DELETE',
264
- __return_type__: ReturnType<MaybeField<TEntry, 'DELETE'>>
265
- },
266
- 'DELETE'
267
- >
268
- >()
269
- }
270
- // Check the prop type of the entry function
271
- if ('PATCH' in entry) {
272
- checkFields<
273
- Diff<
274
- ParamCheck<Request | NextRequest>,
275
- {
276
- __tag__: 'PATCH'
277
- __param_position__: 'first'
278
- __param_type__: FirstArg<MaybeField<TEntry, 'PATCH'>>
279
- },
280
- 'PATCH'
281
- >
282
- >()
283
- checkFields<
284
- Diff<
285
- ParamCheck<RouteContext>,
286
- {
287
- __tag__: 'PATCH'
288
- __param_position__: 'second'
289
- __param_type__: SecondArg<MaybeField<TEntry, 'PATCH'>>
290
- },
291
- 'PATCH'
292
- >
293
- >()
294
-
295
- checkFields<
296
- Diff<
297
- {
298
- __tag__: 'PATCH',
299
- __return_type__: Response | void | never | Promise<Response | void | never>
300
- },
301
- {
302
- __tag__: 'PATCH',
303
- __return_type__: ReturnType<MaybeField<TEntry, 'PATCH'>>
304
- },
305
- 'PATCH'
306
- >
307
- >()
308
- }
309
-
310
- // Check the arguments and return type of the generateStaticParams function
311
- if ('generateStaticParams' in entry) {
312
- checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
313
- checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
314
- }
315
-
316
- export interface PageProps {
317
- params?: Promise<SegmentParams>
318
- searchParams?: Promise<any>
319
- }
320
- export interface LayoutProps {
321
- children?: React.ReactNode
322
-
323
- params?: Promise<SegmentParams>
324
- }
325
-
326
- // =============
327
- // Utility types
328
- type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
329
-
330
- // If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
331
- type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
332
- type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
333
-
334
- type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
335
- type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
336
- type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
337
-
338
- type ParamCheck<T> = {
339
- __tag__: string
340
- __param_position__: string
341
- __param_type__: T
342
- }
343
-
344
- function checkFields<_ extends { [k in keyof any]: never }>() {}
345
-
346
- // https://github.com/sindresorhus/type-fest
347
- type Numeric = number | bigint
348
- type Zero = 0 | 0n
349
- type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
350
- type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'