@ram_28/kf-ai-sdk 1.0.11 → 1.0.12

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 (193) hide show
  1. package/README.md +55 -48
  2. package/dist/api/client.d.ts +14 -14
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/datetime.d.ts +5 -5
  5. package/dist/api/datetime.d.ts.map +1 -1
  6. package/dist/api/index.d.ts +1 -1
  7. package/dist/api/index.d.ts.map +1 -1
  8. package/dist/api/metadata.d.ts +2 -2
  9. package/dist/api/metadata.d.ts.map +1 -1
  10. package/dist/api.cjs +1 -0
  11. package/dist/api.d.ts +4 -0
  12. package/dist/api.d.ts.map +1 -0
  13. package/dist/api.mjs +27 -0
  14. package/dist/api.types.cjs +1 -0
  15. package/dist/api.types.d.ts +4 -0
  16. package/dist/api.types.d.ts.map +1 -0
  17. package/dist/api.types.mjs +1 -0
  18. package/dist/auth/AuthProvider.d.ts +3 -3
  19. package/dist/auth/AuthProvider.d.ts.map +1 -1
  20. package/dist/auth/authClient.d.ts +4 -4
  21. package/dist/auth/authClient.d.ts.map +1 -1
  22. package/dist/auth/authConfig.d.ts +5 -5
  23. package/dist/auth/authConfig.d.ts.map +1 -1
  24. package/dist/auth/index.d.ts +1 -1
  25. package/dist/auth/index.d.ts.map +1 -1
  26. package/dist/auth/types.d.ts +21 -21
  27. package/dist/auth/types.d.ts.map +1 -1
  28. package/dist/auth/useAuth.d.ts +2 -2
  29. package/dist/auth/useAuth.d.ts.map +1 -1
  30. package/dist/auth.cjs +1 -0
  31. package/dist/auth.d.ts +5 -0
  32. package/dist/auth.d.ts.map +1 -0
  33. package/dist/auth.mjs +280 -0
  34. package/dist/auth.types.cjs +1 -0
  35. package/dist/auth.types.d.ts +2 -0
  36. package/dist/auth.types.d.ts.map +1 -0
  37. package/dist/auth.types.mjs +1 -0
  38. package/dist/base-types.d.ts +2 -0
  39. package/dist/base-types.d.ts.map +1 -0
  40. package/dist/client-C15j4O5B.cjs +1 -0
  41. package/dist/client-CfvLiGfP.js +233 -0
  42. package/dist/cn-Dr87sK3i.js +2775 -0
  43. package/dist/cn-mXUIg4vp.cjs +1 -0
  44. package/dist/components/hooks/index.d.ts +3 -3
  45. package/dist/components/hooks/index.d.ts.map +1 -1
  46. package/dist/components/hooks/useFilter/index.d.ts +2 -2
  47. package/dist/components/hooks/useFilter/index.d.ts.map +1 -1
  48. package/dist/components/hooks/useFilter/types.d.ts +19 -31
  49. package/dist/components/hooks/useFilter/types.d.ts.map +1 -1
  50. package/dist/components/hooks/useFilter/useFilter.d.ts +2 -2
  51. package/dist/components/hooks/useFilter/useFilter.d.ts.map +1 -1
  52. package/dist/components/hooks/useForm/apiClient.d.ts +6 -6
  53. package/dist/components/hooks/useForm/apiClient.d.ts.map +1 -1
  54. package/dist/components/hooks/useForm/expressionValidator.utils.d.ts +7 -7
  55. package/dist/components/hooks/useForm/expressionValidator.utils.d.ts.map +1 -1
  56. package/dist/components/hooks/useForm/index.d.ts +5 -5
  57. package/dist/components/hooks/useForm/index.d.ts.map +1 -1
  58. package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts +10 -10
  59. package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts.map +1 -1
  60. package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts +7 -12
  61. package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts.map +1 -1
  62. package/dist/components/hooks/useForm/schemaParser.utils.d.ts +7 -7
  63. package/dist/components/hooks/useForm/schemaParser.utils.d.ts.map +1 -1
  64. package/dist/components/hooks/useForm/types.d.ts +67 -76
  65. package/dist/components/hooks/useForm/types.d.ts.map +1 -1
  66. package/dist/components/hooks/useForm/useForm.d.ts +2 -2
  67. package/dist/components/hooks/useForm/useForm.d.ts.map +1 -1
  68. package/dist/components/hooks/useKanban/apiClient.d.ts +16 -16
  69. package/dist/components/hooks/useKanban/apiClient.d.ts.map +1 -1
  70. package/dist/components/hooks/useKanban/context.d.ts +3 -3
  71. package/dist/components/hooks/useKanban/context.d.ts.map +1 -1
  72. package/dist/components/hooks/useKanban/dragDropManager.d.ts +7 -7
  73. package/dist/components/hooks/useKanban/dragDropManager.d.ts.map +1 -1
  74. package/dist/components/hooks/useKanban/index.d.ts +1 -1
  75. package/dist/components/hooks/useKanban/index.d.ts.map +1 -1
  76. package/dist/components/hooks/useKanban/types.d.ts +65 -67
  77. package/dist/components/hooks/useKanban/types.d.ts.map +1 -1
  78. package/dist/components/hooks/useKanban/useKanban.d.ts +2 -2
  79. package/dist/components/hooks/useKanban/useKanban.d.ts.map +1 -1
  80. package/dist/components/hooks/useTable/index.d.ts +1 -1
  81. package/dist/components/hooks/useTable/index.d.ts.map +1 -1
  82. package/dist/components/hooks/useTable/types.d.ts +10 -10
  83. package/dist/components/hooks/useTable/types.d.ts.map +1 -1
  84. package/dist/components/hooks/useTable/useTable.d.ts +2 -2
  85. package/dist/components/hooks/useTable/useTable.d.ts.map +1 -1
  86. package/dist/filter.cjs +1 -0
  87. package/dist/filter.d.ts +3 -0
  88. package/dist/filter.d.ts.map +1 -0
  89. package/dist/filter.mjs +6 -0
  90. package/dist/filter.types.cjs +1 -0
  91. package/dist/filter.types.d.ts +2 -0
  92. package/dist/filter.types.d.ts.map +1 -0
  93. package/dist/filter.types.mjs +1 -0
  94. package/dist/form.cjs +1 -0
  95. package/dist/form.d.ts +3 -0
  96. package/dist/form.d.ts.map +1 -0
  97. package/dist/form.mjs +1346 -0
  98. package/dist/form.types.cjs +1 -0
  99. package/dist/form.types.d.ts +2 -0
  100. package/dist/form.types.d.ts.map +1 -0
  101. package/dist/form.types.mjs +1 -0
  102. package/dist/jsx-runtime-BYECrxsp.cjs +30 -0
  103. package/dist/jsx-runtime-DGlMoOmv.js +630 -0
  104. package/dist/kanban.cjs +13 -0
  105. package/dist/kanban.d.ts +5 -0
  106. package/dist/kanban.d.ts.map +1 -0
  107. package/dist/kanban.mjs +694 -0
  108. package/dist/kanban.types.cjs +1 -0
  109. package/dist/kanban.types.d.ts +2 -0
  110. package/dist/kanban.types.d.ts.map +1 -0
  111. package/dist/kanban.types.mjs +1 -0
  112. package/dist/kanban.ui.cjs +1 -0
  113. package/dist/kanban.ui.d.ts +2 -0
  114. package/dist/kanban.ui.d.ts.map +1 -0
  115. package/dist/kanban.ui.mjs +104 -0
  116. package/dist/metadata-2FLBsFcf.cjs +1 -0
  117. package/dist/metadata-DBcoDth-.js +43 -0
  118. package/dist/table.cjs +1 -0
  119. package/dist/table.d.ts +2 -0
  120. package/dist/table.d.ts.map +1 -0
  121. package/dist/table.mjs +148 -0
  122. package/dist/table.types.cjs +1 -0
  123. package/dist/table.types.d.ts +2 -0
  124. package/dist/table.types.d.ts.map +1 -0
  125. package/dist/table.types.mjs +1 -0
  126. package/dist/types/base-fields.d.ts +45 -45
  127. package/dist/types/base-fields.d.ts.map +1 -1
  128. package/dist/types/common.d.ts +45 -61
  129. package/dist/types/common.d.ts.map +1 -1
  130. package/dist/types.cjs +1 -0
  131. package/dist/types.mjs +1 -0
  132. package/dist/useFilter-CXFqEHyI.js +129 -0
  133. package/dist/useFilter-D-bCDo6Z.cjs +1 -0
  134. package/dist/utils/formatting.d.ts +4 -4
  135. package/dist/utils/formatting.d.ts.map +1 -1
  136. package/dist/utils.cjs +4 -0
  137. package/dist/utils.d.ts +3 -0
  138. package/dist/utils.d.ts.map +1 -0
  139. package/dist/utils.mjs +105 -0
  140. package/package.json +147 -9
  141. package/sdk/api/client.ts +51 -51
  142. package/sdk/api/datetime.ts +5 -5
  143. package/sdk/api/index.ts +28 -33
  144. package/sdk/api/metadata.ts +4 -4
  145. package/sdk/api.ts +24 -0
  146. package/sdk/api.types.ts +58 -0
  147. package/sdk/auth/AuthProvider.tsx +18 -18
  148. package/sdk/auth/authClient.ts +9 -9
  149. package/sdk/auth/authConfig.ts +9 -9
  150. package/sdk/auth/index.ts +5 -5
  151. package/sdk/auth/types.ts +21 -21
  152. package/sdk/auth/useAuth.ts +2 -2
  153. package/sdk/auth.ts +22 -0
  154. package/sdk/auth.types.ts +28 -0
  155. package/sdk/base-types.ts +45 -0
  156. package/sdk/components/hooks/index.ts +22 -22
  157. package/sdk/components/hooks/useFilter/index.ts +8 -14
  158. package/sdk/components/hooks/useFilter/types.ts +29 -58
  159. package/sdk/components/hooks/useFilter/useFilter.ts +41 -44
  160. package/sdk/components/hooks/useForm/apiClient.ts +8 -8
  161. package/sdk/components/hooks/useForm/expressionValidator.utils.ts +18 -18
  162. package/sdk/components/hooks/useForm/index.ts +24 -24
  163. package/sdk/components/hooks/useForm/optimizedExpressionValidator.utils.ts +22 -22
  164. package/sdk/components/hooks/useForm/ruleClassifier.utils.ts +26 -62
  165. package/sdk/components/hooks/useForm/schemaParser.utils.ts +24 -24
  166. package/sdk/components/hooks/useForm/types.ts +66 -82
  167. package/sdk/components/hooks/useForm/useForm.ts +15 -21
  168. package/sdk/components/hooks/useKanban/apiClient.ts +54 -54
  169. package/sdk/components/hooks/useKanban/context.ts +3 -3
  170. package/sdk/components/hooks/useKanban/dragDropManager.ts +19 -19
  171. package/sdk/components/hooks/useKanban/index.ts +26 -26
  172. package/sdk/components/hooks/useKanban/types.ts +69 -71
  173. package/sdk/components/hooks/useKanban/useKanban.ts +43 -51
  174. package/sdk/components/hooks/useKanban/useKanbanSimple.ts +4 -4
  175. package/sdk/components/hooks/useTable/index.ts +5 -1
  176. package/sdk/components/hooks/useTable/types.ts +10 -10
  177. package/sdk/components/hooks/useTable/useTable.ts +10 -10
  178. package/sdk/filter.ts +13 -0
  179. package/sdk/filter.types.ts +17 -0
  180. package/sdk/form.ts +15 -0
  181. package/sdk/form.types.ts +46 -0
  182. package/sdk/kanban.ts +23 -0
  183. package/sdk/kanban.types.ts +50 -0
  184. package/sdk/kanban.ui.ts +16 -0
  185. package/sdk/table.ts +7 -0
  186. package/sdk/table.types.ts +13 -0
  187. package/sdk/types/base-fields.ts +47 -47
  188. package/sdk/types/common.ts +47 -71
  189. package/sdk/types/index.ts +1 -1
  190. package/sdk/utils/formatting.ts +4 -4
  191. package/sdk/utils.ts +10 -0
  192. package/dist/index.cjs +0 -45
  193. package/dist/index.mjs +0 -6387
@@ -5,18 +5,18 @@
5
5
  // Follows the same structure as useForm and useTable API clients
6
6
 
7
7
  import { api } from "../../../api";
8
- import type {
9
- ListOptions,
10
- ListResponse,
11
- CreateUpdateResponse,
12
- DeleteResponse,
13
- CountResponse
8
+ import type {
9
+ ListOptionsType,
10
+ ListResponseType,
11
+ CreateUpdateResponseType,
12
+ DeleteResponseType,
13
+ CountResponseType
14
14
  } from "../../../types/common";
15
15
  import type {
16
- KanbanCard,
17
- KanbanColumn,
18
- BulkCardUpdateRequest,
19
- BulkColumnUpdateRequest
16
+ KanbanCardType,
17
+ KanbanColumnType,
18
+ BulkCardUpdateRequestType,
19
+ BulkColumnUpdateRequestType
20
20
  } from "./types";
21
21
 
22
22
  // ============================================================
@@ -28,18 +28,18 @@ import type {
28
28
  */
29
29
  export async function fetchColumns<T>(
30
30
  source: string,
31
- options?: ListOptions
32
- ): Promise<KanbanColumn<T>[]> {
33
- const client = api<KanbanColumn<T>>(source);
31
+ options?: ListOptionsType
32
+ ): Promise<KanbanColumnType<T>[]> {
33
+ const client = api<KanbanColumnType<T>>(source);
34
34
 
35
35
  // Build API options for columns query
36
- const apiOptions: ListOptions = {
36
+ const apiOptions: ListOptionsType = {
37
37
  ...options,
38
38
  // Default sort by position if no sort specified - using correct API format
39
39
  Sort: options?.Sort || [{ position: "ASC" }]
40
40
  };
41
41
 
42
- const response: ListResponse<KanbanColumn<T>> = await client.list(apiOptions);
42
+ const response: ListResponseType<KanbanColumnType<T>> = await client.list(apiOptions);
43
43
 
44
44
  // Initialize empty cards array for each column
45
45
  // Cards will be fetched separately and merged
@@ -54,14 +54,14 @@ export async function fetchColumns<T>(
54
54
  */
55
55
  export async function createColumn<T>(
56
56
  source: string,
57
- column: Partial<KanbanColumn<T>>
57
+ column: Partial<KanbanColumnType<T>>
58
58
  ): Promise<string> {
59
- const client = api<KanbanColumn<T>>(source);
59
+ const client = api<KanbanColumnType<T>>(source);
60
60
 
61
61
  // Exclude cards array from creation payload
62
62
  const { cards, ...columnData } = column;
63
63
 
64
- const response: CreateUpdateResponse = await client.create(columnData);
64
+ const response: CreateUpdateResponseType = await client.create(columnData);
65
65
  return response._id;
66
66
  }
67
67
 
@@ -71,9 +71,9 @@ export async function createColumn<T>(
71
71
  export async function updateColumn<T>(
72
72
  source: string,
73
73
  id: string,
74
- updates: Partial<KanbanColumn<T>>
74
+ updates: Partial<KanbanColumnType<T>>
75
75
  ): Promise<void> {
76
- const client = api<KanbanColumn<T>>(source);
76
+ const client = api<KanbanColumnType<T>>(source);
77
77
 
78
78
  // Exclude cards array from update payload
79
79
  const { cards, ...columnUpdates } = updates;
@@ -99,7 +99,7 @@ export async function reorderColumns<T>(
99
99
  source: string,
100
100
  columnIds: string[]
101
101
  ): Promise<void> {
102
- const client = api<KanbanColumn<T>>(source);
102
+ const client = api<KanbanColumnType<T>>(source);
103
103
 
104
104
  // Update position for each column
105
105
  const updates = columnIds.map((id, index) => ({
@@ -124,12 +124,12 @@ export async function reorderColumns<T>(
124
124
  */
125
125
  export async function fetchCards<T>(
126
126
  source: string,
127
- options?: ListOptions
128
- ): Promise<KanbanCard<T>[]> {
129
- const client = api<KanbanCard<T>>(source);
127
+ options?: ListOptionsType
128
+ ): Promise<KanbanCardType<T>[]> {
129
+ const client = api<KanbanCardType<T>>(source);
130
130
 
131
131
  // Build API options for cards query
132
- const apiOptions: ListOptions = {
132
+ const apiOptions: ListOptionsType = {
133
133
  ...options,
134
134
  // Default sort by column and position if no sort specified - using correct API format
135
135
  Sort: options?.Sort || [
@@ -138,7 +138,7 @@ export async function fetchCards<T>(
138
138
  ]
139
139
  };
140
140
 
141
- const response: ListResponse<KanbanCard<T>> = await client.list(apiOptions);
141
+ const response: ListResponseType<KanbanCardType<T>> = await client.list(apiOptions);
142
142
  return response.Data;
143
143
  }
144
144
 
@@ -147,11 +147,11 @@ export async function fetchCards<T>(
147
147
  */
148
148
  export async function createCard<T>(
149
149
  source: string,
150
- card: Partial<KanbanCard<T>> & { columnId: string }
150
+ card: Partial<KanbanCardType<T>> & { columnId: string }
151
151
  ): Promise<string> {
152
- const client = api<KanbanCard<T>>(source);
152
+ const client = api<KanbanCardType<T>>(source);
153
153
 
154
- const response: CreateUpdateResponse = await client.create(card);
154
+ const response: CreateUpdateResponseType = await client.create(card);
155
155
  return response._id;
156
156
  }
157
157
 
@@ -161,9 +161,9 @@ export async function createCard<T>(
161
161
  export async function updateCard<T>(
162
162
  source: string,
163
163
  id: string,
164
- updates: Partial<KanbanCard<T>>
164
+ updates: Partial<KanbanCardType<T>>
165
165
  ): Promise<void> {
166
- const client = api<KanbanCard<T>>(source);
166
+ const client = api<KanbanCardType<T>>(source);
167
167
  await client.update(id, updates);
168
168
  }
169
169
 
@@ -187,7 +187,7 @@ export async function moveCard<T>(
187
187
  toColumnId: string,
188
188
  position?: number
189
189
  ): Promise<void> {
190
- const client = api<KanbanCard<T>>(source);
190
+ const client = api<KanbanCardType<T>>(source);
191
191
 
192
192
  const updates: any = {
193
193
  columnId: toColumnId,
@@ -205,7 +205,7 @@ export async function reorderCards<T>(
205
205
  cardIds: string[],
206
206
  columnId: string
207
207
  ): Promise<void> {
208
- const client = api<KanbanCard<T>>(source);
208
+ const client = api<KanbanCardType<T>>(source);
209
209
 
210
210
  // Update position for each card
211
211
  const updates = cardIds.map((id, index) => ({
@@ -230,9 +230,9 @@ export async function reorderCards<T>(
230
230
  */
231
231
  export async function bulkUpdateCards<T>(
232
232
  source: string,
233
- request: BulkCardUpdateRequest<T>
233
+ request: BulkCardUpdateRequestType<T>
234
234
  ): Promise<void> {
235
- const client = api<KanbanCard<T>>(source);
235
+ const client = api<KanbanCardType<T>>(source);
236
236
 
237
237
  await Promise.all(
238
238
  request.updates.map(update =>
@@ -246,9 +246,9 @@ export async function bulkUpdateCards<T>(
246
246
  */
247
247
  export async function bulkUpdateColumns<T>(
248
248
  source: string,
249
- request: BulkColumnUpdateRequest<T>
249
+ request: BulkColumnUpdateRequestType<T>
250
250
  ): Promise<void> {
251
- const client = api<KanbanColumn<T>>(source);
251
+ const client = api<KanbanColumnType<T>>(source);
252
252
 
253
253
  await Promise.all(
254
254
  request.updates.map(update =>
@@ -266,7 +266,7 @@ export async function bulkMoveCards<T>(
266
266
  toColumnId: string,
267
267
  startPosition = 0
268
268
  ): Promise<void> {
269
- const client = api<KanbanCard<T>>(cardSource);
269
+ const client = api<KanbanCardType<T>>(cardSource);
270
270
 
271
271
  const updates = cardIds.map((cardId, index) => ({
272
272
  cardId,
@@ -296,7 +296,7 @@ export async function getCardCount(
296
296
  ): Promise<number> {
297
297
  const client = api(source);
298
298
 
299
- const options: ListOptions = {
299
+ const options: ListOptionsType = {
300
300
  Filter: {
301
301
  Operator: "And",
302
302
  Condition: [
@@ -310,7 +310,7 @@ export async function getCardCount(
310
310
  }
311
311
  };
312
312
 
313
- const response: CountResponse = await client.count(options);
313
+ const response: CountResponseType = await client.count(options);
314
314
  return response.Count;
315
315
  }
316
316
 
@@ -319,10 +319,10 @@ export async function getCardCount(
319
319
  */
320
320
  export async function getTotalCardCount(
321
321
  source: string,
322
- options?: ListOptions
322
+ options?: ListOptionsType
323
323
  ): Promise<number> {
324
324
  const client = api(source);
325
- const response: CountResponse = await client.count(options);
325
+ const response: CountResponseType = await client.count(options);
326
326
  return response.Count;
327
327
  }
328
328
 
@@ -332,11 +332,11 @@ export async function getTotalCardCount(
332
332
  export async function searchCards<T>(
333
333
  source: string,
334
334
  searchQuery: string,
335
- additionalOptions?: ListOptions
336
- ): Promise<KanbanCard<T>[]> {
337
- const client = api<KanbanCard<T>>(source);
335
+ additionalOptions?: ListOptionsType
336
+ ): Promise<KanbanCardType<T>[]> {
337
+ const client = api<KanbanCardType<T>>(source);
338
338
 
339
- const options: ListOptions = {
339
+ const options: ListOptionsType = {
340
340
  ...additionalOptions,
341
341
  Search: searchQuery,
342
342
  Sort: additionalOptions?.Sort || [
@@ -345,7 +345,7 @@ export async function searchCards<T>(
345
345
  ]
346
346
  };
347
347
 
348
- const response: ListResponse<KanbanCard<T>> = await client.list(options);
348
+ const response: ListResponseType<KanbanCardType<T>> = await client.list(options);
349
349
  return response.Data;
350
350
  }
351
351
 
@@ -357,9 +357,9 @@ export async function searchCards<T>(
357
357
  * Merge cards into their respective columns
358
358
  */
359
359
  export function mergeCardsIntoColumns<T>(
360
- columns: KanbanColumn<T>[],
361
- cards: KanbanCard<T>[]
362
- ): KanbanColumn<T>[] {
360
+ columns: KanbanColumnType<T>[],
361
+ cards: KanbanCardType<T>[]
362
+ ): KanbanColumnType<T>[] {
363
363
  // Group cards by columnId
364
364
  const cardsByColumn = cards.reduce((acc, card) => {
365
365
  if (!acc[card.columnId]) {
@@ -367,7 +367,7 @@ export function mergeCardsIntoColumns<T>(
367
367
  }
368
368
  acc[card.columnId].push(card);
369
369
  return acc;
370
- }, {} as Record<string, KanbanCard<T>[]>);
370
+ }, {} as Record<string, KanbanCardType<T>[]>);
371
371
 
372
372
  // Assign cards to their respective columns
373
373
  return columns.map(column => ({
@@ -381,7 +381,7 @@ export function mergeCardsIntoColumns<T>(
381
381
  * Calculate optimal position for inserting a new card
382
382
  */
383
383
  export function calculateCardPosition<T>(
384
- column: KanbanColumn<T>,
384
+ column: KanbanColumnType<T>,
385
385
  insertIndex?: number
386
386
  ): number {
387
387
  if (column.cards.length === 0) {
@@ -410,7 +410,7 @@ export function calculateCardPosition<T>(
410
410
  * Calculate optimal position for inserting a new column
411
411
  */
412
412
  export function calculateColumnPosition<T>(
413
- columns: KanbanColumn<T>[],
413
+ columns: KanbanColumnType<T>[],
414
414
  insertIndex?: number
415
415
  ): number {
416
416
  if (columns.length === 0) {
@@ -478,7 +478,7 @@ export function handleKanbanApiError(
478
478
  export function validateApiResponse<T>(
479
479
  response: any,
480
480
  expectedType: 'list' | 'single' | 'create' | 'delete'
481
- ): response is ListResponse<T> | T | CreateUpdateResponse | DeleteResponse {
481
+ ): response is ListResponseType<T> | T | CreateUpdateResponseType | DeleteResponseType {
482
482
  switch (expectedType) {
483
483
  case 'list':
484
484
  return response && Array.isArray(response.Data);
@@ -1,7 +1,7 @@
1
1
  import { createContext, useContext } from "react";
2
- import { UseKanbanReturn } from "./types";
2
+ import { UseKanbanReturnType } from "./types";
3
3
 
4
- export const KanbanContext = createContext<UseKanbanReturn<any> | null>(null);
4
+ export const KanbanContext = createContext<UseKanbanReturnType<any> | null>(null);
5
5
 
6
6
  export function useKanbanContext<T extends Record<string, any> = any>() {
7
7
  const context = useContext(KanbanContext);
@@ -10,5 +10,5 @@ export function useKanbanContext<T extends Record<string, any> = any>() {
10
10
  "Kanban components must be used within a KanbanBoard component"
11
11
  );
12
12
  }
13
- return context as UseKanbanReturn<T>;
13
+ return context as UseKanbanReturnType<T>;
14
14
  }
@@ -6,10 +6,10 @@
6
6
 
7
7
  import { useState, useCallback, useRef, useEffect } from "react";
8
8
  import type {
9
- KanbanCard,
10
- KanbanColumn,
11
- DragDropState,
12
- DragDropManager
9
+ KanbanCardType,
10
+ KanbanColumnType,
11
+ DragDropStateType,
12
+ DragDropManagerType
13
13
  } from "./types";
14
14
 
15
15
  // ============================================================
@@ -30,17 +30,17 @@ export function useDragDropManager<T>({
30
30
  columns,
31
31
  announceMove
32
32
  }: {
33
- onCardMove?: (card: KanbanCard<T>, fromColumnId: string, toColumnId: string) => void;
33
+ onCardMove?: (card: KanbanCardType<T>, fromColumnId: string, toColumnId: string) => void;
34
34
  onError?: (error: Error) => void;
35
- columns: KanbanColumn<T>[];
36
- announceMove?: (card: KanbanCard<T>, fromColumn: string, toColumn: string) => void;
37
- }): DragDropManager<T> {
35
+ columns: KanbanColumnType<T>[];
36
+ announceMove?: (card: KanbanCardType<T>, fromColumn: string, toColumn: string) => void;
37
+ }): DragDropManagerType<T> {
38
38
 
39
39
  // ============================================================
40
40
  // STATE MANAGEMENT
41
41
  // ============================================================
42
42
 
43
- const [dragState, setDragState] = useState<DragDropState<T>>({
43
+ const [dragState, setDragState] = useState<DragDropStateType<T>>({
44
44
  isDragging: false,
45
45
  draggedCard: null,
46
46
  dragOverColumn: null,
@@ -51,7 +51,7 @@ export function useDragDropManager<T>({
51
51
  // Refs for managing drag operations
52
52
  const dragImageRef = useRef<HTMLElement | null>(null);
53
53
  const autoScrollTimeoutRef = useRef<NodeJS.Timeout | null>(null);
54
- const touchStartRef = useRef<{ x: number; y: number; card: KanbanCard<T> } | null>(null);
54
+ const touchStartRef = useRef<{ x: number; y: number; card: KanbanCardType<T> } | null>(null);
55
55
 
56
56
  // ============================================================
57
57
  // UTILITY FUNCTIONS
@@ -73,11 +73,11 @@ export function useDragDropManager<T>({
73
73
  }
74
74
  }, []);
75
75
 
76
- const findColumnById = useCallback((columnId: string): KanbanColumn<T> | null => {
76
+ const findColumnById = useCallback((columnId: string): KanbanColumnType<T> | null => {
77
77
  return columns.find(col => col._id === columnId) || null;
78
78
  }, [columns]);
79
79
 
80
- const findCardById = useCallback((cardId: string): { card: KanbanCard<T>; column: KanbanColumn<T> } | null => {
80
+ const findCardById = useCallback((cardId: string): { card: KanbanCardType<T>; column: KanbanColumnType<T> } | null => {
81
81
  for (const column of columns) {
82
82
  const card = column.cards.find(c => c._id === cardId);
83
83
  if (card) {
@@ -91,7 +91,7 @@ export function useDragDropManager<T>({
91
91
  // MOUSE DRAG HANDLERS
92
92
  // ============================================================
93
93
 
94
- const handleDragStart = useCallback((event: DragEvent, card: KanbanCard<T>) => {
94
+ const handleDragStart = useCallback((event: DragEvent, card: KanbanCardType<T>) => {
95
95
  try {
96
96
  const cardElement = event.target as HTMLElement;
97
97
  const sourceColumn = findColumnById(card.columnId);
@@ -260,7 +260,7 @@ export function useDragDropManager<T>({
260
260
  // KEYBOARD NAVIGATION
261
261
  // ============================================================
262
262
 
263
- const handleKeyDown = useCallback((event: KeyboardEvent, card: KanbanCard<T>) => {
263
+ const handleKeyDown = useCallback((event: KeyboardEvent, card: KanbanCardType<T>) => {
264
264
  if (!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Enter', 'Space', 'Escape'].includes(event.key)) {
265
265
  return;
266
266
  }
@@ -323,7 +323,7 @@ export function useDragDropManager<T>({
323
323
  // TOUCH HANDLERS
324
324
  // ============================================================
325
325
 
326
- const handleTouchStart = useCallback((event: TouchEvent, card: KanbanCard<T>) => {
326
+ const handleTouchStart = useCallback((event: TouchEvent, card: KanbanCardType<T>) => {
327
327
  const touch = event.touches[0];
328
328
  touchStartRef.current = {
329
329
  x: touch.clientX,
@@ -399,7 +399,7 @@ export function useDragDropManager<T>({
399
399
  // ACCESSIBILITY ANNOUNCEMENTS
400
400
  // ============================================================
401
401
 
402
- const defaultAnnounceMove = useCallback((card: KanbanCard<T>, fromColumn: string, toColumn: string) => {
402
+ const defaultAnnounceMove = useCallback((card: KanbanCardType<T>, fromColumn: string, toColumn: string) => {
403
403
  const message = `Moved "${card.title}" from ${fromColumn} to ${toColumn}`;
404
404
 
405
405
  // Create live region announcement
@@ -474,7 +474,7 @@ export function useDragDropManager<T>({
474
474
  */
475
475
  export function calculateDropPosition<T>(
476
476
  event: DragEvent,
477
- column: KanbanColumn<T>,
477
+ column: KanbanColumnType<T>,
478
478
  cardHeight = 80
479
479
  ): number {
480
480
  const columnElement = (event.target as HTMLElement).closest('.kanban-column');
@@ -511,8 +511,8 @@ export function removeDragFeedback(element: HTMLElement) {
511
511
  * Check if a column can accept a drop
512
512
  */
513
513
  export function canAcceptDrop<T>(
514
- column: KanbanColumn<T>,
515
- draggedCard: KanbanCard<T>
514
+ column: KanbanColumnType<T>,
515
+ draggedCard: KanbanCardType<T>
516
516
  ): { canDrop: boolean; reason?: string } {
517
517
  // Check if column has a limit
518
518
  if (column.limit && column.cards.length >= column.limit && draggedCard.columnId !== column._id) {
@@ -7,44 +7,44 @@ export { KanbanContext, useKanbanContext } from './context';
7
7
 
8
8
  export type {
9
9
  // Core interfaces
10
- UseKanbanOptions,
11
- UseKanbanReturn,
12
- KanbanCard,
13
- KanbanColumn,
14
- ColumnConfig,
15
- ColumnDefinition,
10
+ UseKanbanOptionsType,
11
+ UseKanbanReturnType,
12
+ KanbanCardType,
13
+ KanbanColumnType,
14
+ ColumnConfigType,
15
+ ColumnDefinitionType,
16
16
 
17
17
  // Operations
18
- CardOperations,
19
- SearchOperations,
18
+ CardOperationsType,
19
+ SearchOperationsType,
20
20
 
21
21
  // Drag & Drop
22
- DragDropState,
23
- DragDropHandlers,
24
- DragDropManager,
22
+ DragDropStateType,
23
+ DragDropHandlersType,
24
+ DragDropManagerType,
25
25
 
26
26
  // API Types
27
- CardApiResponse,
28
- ColumnApiResponse,
29
- MoveCardRequest,
30
- ReorderRequest,
31
- BulkCardUpdateRequest,
32
- BulkColumnUpdateRequest,
27
+ CardApiResponseType,
28
+ ColumnApiResponseType,
29
+ MoveCardRequestType,
30
+ ReorderRequestType,
31
+ BulkCardUpdateRequestType,
32
+ BulkColumnUpdateRequestType,
33
33
 
34
34
  // Validation
35
- ValidationResult,
36
- CardValidationContext,
37
- ColumnValidationContext,
35
+ ValidationResultType,
36
+ CardValidationContextType,
37
+ ColumnValidationContextType,
38
38
 
39
39
  // Events
40
+ KanbanEventTypeType,
40
41
  KanbanEventType,
41
- KanbanEvent,
42
42
 
43
43
  // Utility Types
44
- ExtractCardType,
45
- PartialBy,
46
- CreateCardInput,
47
- CreateColumnInput,
44
+ ExtractCardTypeType,
45
+ PartialByType,
46
+ CreateCardInputType,
47
+ CreateColumnInputType,
48
48
  } from './types';
49
49
 
50
50
  // Export utility functions for advanced use cases
@@ -59,4 +59,4 @@ export {
59
59
 
60
60
  export {
61
61
  useDragDropManager
62
- } from './dragDropManager';
62
+ } from './dragDropManager';