@speakableio/core 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks.d.ts DELETED
@@ -1,911 +0,0 @@
1
- import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { QueryClient } from '@tanstack/react-query';
3
- import { A as AssignmentWithId, C as CustomTimestamp, a as ActivityPageType, e as ScoreWithId, S as Score, f as PageScore, b as PageActivityWithId, P as PageActivity } from './assignment.model-Bm9gE2YK.js';
4
- import { A as AssignmentAnalyticsType } from './assignment.constants-BIKM6fYi.js';
5
- import { SetWithId } from './models.js';
6
- import { V as VerificationCardStatus } from './card.constants-DhKFipX3.js';
7
- import { a as SpeakableNotificationType } from './notification.constants-B72fb734.js';
8
- import { S as SpeakablePlanTypes } from './speakable-plans-BjWWEWrQ.js';
9
- import '@react-native-firebase/firestore';
10
- import 'firebase/firestore';
11
-
12
- declare const assignmentQueryKeys: {
13
- all: readonly ["assignments"];
14
- byId: (id: string) => readonly ["assignments", string];
15
- list: () => readonly ["assignments", "list"];
16
- };
17
- declare function useAssignment({ assignmentId, enabled, analyticType, userId, }: {
18
- assignmentId: string;
19
- enabled?: boolean;
20
- analyticType?: AssignmentAnalyticsType;
21
- userId: string;
22
- }): _tanstack_react_query.UseQueryResult<AssignmentWithId | {
23
- scores: any;
24
- id: string;
25
- isAvailable: boolean;
26
- name: string;
27
- description: string;
28
- scheduledTime?: string | null;
29
- dueTime?: {
30
- hours: number;
31
- minutes: number;
32
- nanos: number;
33
- };
34
- speakableio: boolean;
35
- owners: string[];
36
- image: {
37
- path: string | null;
38
- url: string;
39
- };
40
- dueDate: {
41
- day: number;
42
- month: number;
43
- year: number;
44
- };
45
- teacherName: string;
46
- courseWorkId: string | null;
47
- dueDateTimestamp: CustomTimestamp;
48
- scheduledTimeTimestamp: number;
49
- active: boolean;
50
- voice: string | null;
51
- setId: string;
52
- dateMade: {
53
- seconds: number;
54
- nanoseconds: number;
55
- };
56
- maxPoints: number;
57
- courseId: string;
58
- isAssessment: boolean;
59
- ltiDeeplink?: string;
60
- content?: string[];
61
- weights?: Record<string, number>;
62
- language?: string;
63
- types?: { [key in ActivityPageType]?: number; };
64
- aiEnabled?: boolean;
65
- chat_experience?: boolean;
66
- } | null, Error>;
67
-
68
- declare const scoreQueryKeys: {
69
- all: readonly ["scores"];
70
- byId: (id: string) => readonly ["scores", string];
71
- list: () => readonly ["scores", "list"];
72
- };
73
- declare function useScore({ isAssignment, activityId, userId, courseId, enabled, googleClassroomUserId, }: {
74
- userId: string;
75
- isAssignment: boolean;
76
- activityId: string;
77
- courseId?: string;
78
- enabled?: boolean;
79
- googleClassroomUserId?: string;
80
- }): _tanstack_react_query.UseQueryResult<ScoreWithId, Error>;
81
- declare function useUpdateScore(): {
82
- mutationUpdateScore: _tanstack_react_query.UseMutationResult<Promise<void>, Error, {
83
- userId: string;
84
- data: Partial<Score>;
85
- isAssignment: boolean;
86
- activityId: string;
87
- }, {
88
- previousData: Partial<Score> | undefined;
89
- }>;
90
- };
91
- declare function useUpdateCardScore({ isAssignment, activityId, userId, cardIds, weights, }: {
92
- isAssignment: boolean;
93
- userId: string;
94
- activityId: string;
95
- cardIds: string[];
96
- weights: Record<string, number>;
97
- }): {
98
- mutationUpdateCardScore: _tanstack_react_query.UseMutationResult<{
99
- cardId: string;
100
- scoresUpdated: Score;
101
- }, Error, {
102
- cardId: string;
103
- cardScore: PageScore;
104
- }, void>;
105
- };
106
- declare function useClearScore(): {
107
- mutationClearScore: _tanstack_react_query.UseMutationResult<{
108
- update: Partial<Score>;
109
- activityId: string;
110
- }, Error, {
111
- isAssignment: boolean;
112
- cardId: string;
113
- cardScores: PageScore;
114
- userId: string;
115
- activityId: string;
116
- }, unknown>;
117
- };
118
- declare function useSubmitAssignmentScore({ onAssignmentSubmitted, studentName, }: {
119
- onAssignmentSubmitted: (assignmentId: string) => void;
120
- studentName: string;
121
- }): {
122
- submitAssignmentScore: _tanstack_react_query.UseMutateAsyncFunction<{
123
- success: boolean;
124
- message: string;
125
- error?: undefined;
126
- } | {
127
- success: boolean;
128
- error: unknown;
129
- message?: undefined;
130
- }, Error, {
131
- assignment: {
132
- id: string;
133
- name: string;
134
- owners: string[];
135
- courseId: string;
136
- courseWorkId: string;
137
- isAssessment: boolean;
138
- maxPoints: number;
139
- };
140
- userId: string;
141
- cardIds: string[];
142
- weights: Record<string, number>;
143
- scores: Score;
144
- status: "FINALIZED" | "IN_PROGRESS" | "PENDING_REVIEW";
145
- }, unknown>;
146
- isLoading: boolean;
147
- };
148
- declare function useSubmitPracticeScore(): {
149
- submitPracticeScore: _tanstack_react_query.UseMutateAsyncFunction<{
150
- success: boolean;
151
- message: string;
152
- error?: undefined;
153
- } | {
154
- success: boolean;
155
- error: unknown;
156
- message?: undefined;
157
- }, Error, {
158
- setId: string;
159
- userId: string;
160
- scores: Score;
161
- }, unknown>;
162
- isLoading: boolean;
163
- };
164
-
165
- declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData, }: {
166
- id: string;
167
- isAssignment: boolean;
168
- onAssignmentSubmitted: (assignmentId: string) => void;
169
- ltiData?: {
170
- lineItemId?: string;
171
- lti_id?: string;
172
- serviceKey?: string;
173
- };
174
- }): {
175
- set: {
176
- data: SetWithId | null | undefined;
177
- query: _tanstack_react_query.UseQueryResult<SetWithId | null, Error>;
178
- };
179
- cards: {
180
- data: Record<string, PageActivityWithId> | null;
181
- query: _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>[];
182
- cardsArray: PageActivityWithId[];
183
- };
184
- assignment: {
185
- data: AssignmentWithId | {
186
- scores: any;
187
- id: string;
188
- isAvailable: boolean;
189
- name: string;
190
- description: string;
191
- scheduledTime?: string | null;
192
- dueTime?: {
193
- hours: number;
194
- minutes: number;
195
- nanos: number;
196
- };
197
- speakableio: boolean;
198
- owners: string[];
199
- image: {
200
- path: string | null;
201
- url: string;
202
- };
203
- dueDate: {
204
- day: number;
205
- month: number;
206
- year: number;
207
- };
208
- teacherName: string;
209
- courseWorkId: string | null;
210
- dueDateTimestamp: CustomTimestamp;
211
- scheduledTimeTimestamp: number;
212
- active: boolean;
213
- voice: string | null;
214
- setId: string;
215
- dateMade: {
216
- seconds: number;
217
- nanoseconds: number;
218
- };
219
- maxPoints: number;
220
- courseId: string;
221
- isAssessment: boolean;
222
- ltiDeeplink?: string;
223
- content?: string[];
224
- weights?: Record<string, number>;
225
- language?: string;
226
- types?: { [key in ActivityPageType]?: number; };
227
- aiEnabled?: boolean;
228
- chat_experience?: boolean;
229
- } | null | undefined;
230
- query: _tanstack_react_query.UseQueryResult<AssignmentWithId | {
231
- scores: any;
232
- id: string;
233
- isAvailable: boolean;
234
- name: string;
235
- description: string;
236
- scheduledTime?: string | null;
237
- dueTime?: {
238
- hours: number;
239
- minutes: number;
240
- nanos: number;
241
- };
242
- speakableio: boolean;
243
- owners: string[];
244
- image: {
245
- path: string | null;
246
- url: string;
247
- };
248
- dueDate: {
249
- day: number;
250
- month: number;
251
- year: number;
252
- };
253
- teacherName: string;
254
- courseWorkId: string | null;
255
- dueDateTimestamp: CustomTimestamp;
256
- scheduledTimeTimestamp: number;
257
- active: boolean;
258
- voice: string | null;
259
- setId: string;
260
- dateMade: {
261
- seconds: number;
262
- nanoseconds: number;
263
- };
264
- maxPoints: number;
265
- courseId: string;
266
- isAssessment: boolean;
267
- ltiDeeplink?: string;
268
- content?: string[];
269
- weights?: Record<string, number>;
270
- language?: string;
271
- types?: { [key in ActivityPageType]?: number; };
272
- aiEnabled?: boolean;
273
- chat_experience?: boolean;
274
- } | null, Error>;
275
- };
276
- scores: {
277
- data: ScoreWithId | undefined;
278
- query: _tanstack_react_query.UseQueryResult<ScoreWithId, Error>;
279
- actions: {
280
- update: (data: Partial<Score>) => void;
281
- clear: ({ cardId, wasCompleted, }: {
282
- cardId: string;
283
- wasCompleted?: boolean;
284
- }) => void;
285
- submit: () => Promise<{
286
- success: boolean;
287
- message: string;
288
- error?: undefined;
289
- } | {
290
- success: boolean;
291
- error: unknown;
292
- message?: undefined;
293
- }>;
294
- updateCard: (cardId: string, cardScore: PageScore) => void;
295
- logGradingStandardEntry: ({ cardId, gradingStandard, type, }: {
296
- cardId: string;
297
- gradingStandard: {
298
- level: string;
299
- justification: string;
300
- };
301
- type: "actfl" | "wida" | "custom";
302
- }) => void;
303
- };
304
- };
305
- };
306
-
307
- interface StudentTeacherPlanResult {
308
- studentId: string;
309
- teachers: {
310
- teacherId: string;
311
- teacherName: string;
312
- teacherEmail: string;
313
- plan: string;
314
- hasActiveTeamPlan: boolean;
315
- hasActiveOrgPlan: boolean;
316
- hasUnlimitedAccess: boolean;
317
- }[];
318
- hasTeacherWithTeamPlan: boolean;
319
- hasTeacherWithOrgPlan: boolean;
320
- hasTeacherWithUnlimitedAccess: boolean;
321
- canAccessFeedback: boolean;
322
- reason?: string;
323
- }
324
- interface ActivityFeedbackAccess {
325
- canAccessFeedback: boolean;
326
- reason?: string;
327
- isUnlimited: boolean;
328
- accessType: 'ai_enabled' | 'teacher_preview' | 'student_with_teacher_plan' | 'none';
329
- }
330
- declare const activityFeedbackAccessQueryKeys: {
331
- activityFeedbackAccess: (args: {
332
- aiEnabled: boolean;
333
- isActivityRoute: boolean;
334
- }) => readonly ["activityFeedbackAccess", ...boolean[]];
335
- };
336
- /**
337
- * Hook to check feedback permissions for both students and teachers
338
- *
339
- * Permission Logic:
340
- * 1. aiEnabled: true → Allow feedback access always (highest priority)
341
- * 2. Teachers on /activity route → Always allowed (ADMIN role)
342
- * 3. Students on /activity route → Need teacher with active plan (team/org)
343
- *
344
- * @param params - Parameters for permission checking
345
- * @returns Feedback permissions information
346
- */
347
- declare const useActivityFeedbackAccess: ({ aiEnabled, isActivityRoute, }: {
348
- aiEnabled?: boolean;
349
- isActivityRoute?: boolean;
350
- }) => {
351
- data: ActivityFeedbackAccess;
352
- error: Error;
353
- isError: true;
354
- isPending: false;
355
- isLoading: false;
356
- isLoadingError: false;
357
- isRefetchError: true;
358
- isSuccess: false;
359
- isPlaceholderData: false;
360
- status: "error";
361
- dataUpdatedAt: number;
362
- errorUpdatedAt: number;
363
- failureCount: number;
364
- failureReason: Error | null;
365
- errorUpdateCount: number;
366
- isFetched: boolean;
367
- isFetchedAfterMount: boolean;
368
- isFetching: boolean;
369
- isInitialLoading: boolean;
370
- isPaused: boolean;
371
- isRefetching: boolean;
372
- isStale: boolean;
373
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
374
- fetchStatus: _tanstack_react_query.FetchStatus;
375
- promise: Promise<ActivityFeedbackAccess>;
376
- } | {
377
- data: ActivityFeedbackAccess;
378
- error: null;
379
- isError: false;
380
- isPending: false;
381
- isLoading: false;
382
- isLoadingError: false;
383
- isRefetchError: false;
384
- isSuccess: true;
385
- isPlaceholderData: false;
386
- status: "success";
387
- dataUpdatedAt: number;
388
- errorUpdatedAt: number;
389
- failureCount: number;
390
- failureReason: Error | null;
391
- errorUpdateCount: number;
392
- isFetched: boolean;
393
- isFetchedAfterMount: boolean;
394
- isFetching: boolean;
395
- isInitialLoading: boolean;
396
- isPaused: boolean;
397
- isRefetching: boolean;
398
- isStale: boolean;
399
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
400
- fetchStatus: _tanstack_react_query.FetchStatus;
401
- promise: Promise<ActivityFeedbackAccess>;
402
- } | {
403
- data: undefined;
404
- error: Error;
405
- isError: true;
406
- isPending: false;
407
- isLoading: false;
408
- isLoadingError: true;
409
- isRefetchError: false;
410
- isSuccess: false;
411
- isPlaceholderData: false;
412
- status: "error";
413
- dataUpdatedAt: number;
414
- errorUpdatedAt: number;
415
- failureCount: number;
416
- failureReason: Error | null;
417
- errorUpdateCount: number;
418
- isFetched: boolean;
419
- isFetchedAfterMount: boolean;
420
- isFetching: boolean;
421
- isInitialLoading: boolean;
422
- isPaused: boolean;
423
- isRefetching: boolean;
424
- isStale: boolean;
425
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
426
- fetchStatus: _tanstack_react_query.FetchStatus;
427
- promise: Promise<ActivityFeedbackAccess>;
428
- } | {
429
- data: undefined;
430
- error: null;
431
- isError: false;
432
- isPending: true;
433
- isLoading: true;
434
- isLoadingError: false;
435
- isRefetchError: false;
436
- isSuccess: false;
437
- isPlaceholderData: false;
438
- status: "pending";
439
- dataUpdatedAt: number;
440
- errorUpdatedAt: number;
441
- failureCount: number;
442
- failureReason: Error | null;
443
- errorUpdateCount: number;
444
- isFetched: boolean;
445
- isFetchedAfterMount: boolean;
446
- isFetching: boolean;
447
- isInitialLoading: boolean;
448
- isPaused: boolean;
449
- isRefetching: boolean;
450
- isStale: boolean;
451
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
452
- fetchStatus: _tanstack_react_query.FetchStatus;
453
- promise: Promise<ActivityFeedbackAccess>;
454
- } | {
455
- data: undefined;
456
- error: null;
457
- isError: false;
458
- isPending: true;
459
- isLoadingError: false;
460
- isRefetchError: false;
461
- isSuccess: false;
462
- isPlaceholderData: false;
463
- status: "pending";
464
- dataUpdatedAt: number;
465
- errorUpdatedAt: number;
466
- failureCount: number;
467
- failureReason: Error | null;
468
- errorUpdateCount: number;
469
- isFetched: boolean;
470
- isFetchedAfterMount: boolean;
471
- isFetching: boolean;
472
- isLoading: boolean;
473
- isInitialLoading: boolean;
474
- isPaused: boolean;
475
- isRefetching: boolean;
476
- isStale: boolean;
477
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
478
- fetchStatus: _tanstack_react_query.FetchStatus;
479
- promise: Promise<ActivityFeedbackAccess>;
480
- } | {
481
- data: ActivityFeedbackAccess;
482
- isError: false;
483
- error: null;
484
- isPending: false;
485
- isLoading: false;
486
- isLoadingError: false;
487
- isRefetchError: false;
488
- isSuccess: true;
489
- isPlaceholderData: true;
490
- status: "success";
491
- dataUpdatedAt: number;
492
- errorUpdatedAt: number;
493
- failureCount: number;
494
- failureReason: Error | null;
495
- errorUpdateCount: number;
496
- isFetched: boolean;
497
- isFetchedAfterMount: boolean;
498
- isFetching: boolean;
499
- isInitialLoading: boolean;
500
- isPaused: boolean;
501
- isRefetching: boolean;
502
- isStale: boolean;
503
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
504
- fetchStatus: _tanstack_react_query.FetchStatus;
505
- promise: Promise<ActivityFeedbackAccess>;
506
- };
507
-
508
- declare const useBaseOpenAI: ({ onTranscriptSuccess, onTranscriptError, onCompletionSuccess, onCompletionError, aiEnabled, submitAudioResponse, uploadAudioAndGetTranscript, onGetAudioUrlAndTranscript, }: {
509
- onTranscriptSuccess: (transcript: string) => void;
510
- onTranscriptError: ({ type, message }: {
511
- type: string;
512
- message: string;
513
- }) => void;
514
- onCompletionSuccess: (completion: any) => void;
515
- onCompletionError: ({ type, message }: {
516
- type: string;
517
- message: string;
518
- }) => void;
519
- aiEnabled: boolean;
520
- submitAudioResponse: (audio: string) => Promise<{
521
- url: string;
522
- fileName: string;
523
- }>;
524
- uploadAudioAndGetTranscript: (audio: string, language: string) => Promise<{
525
- transcript: string;
526
- audioUrl: string;
527
- }>;
528
- onGetAudioUrlAndTranscript?: (args: {
529
- transcript?: string;
530
- audioUrl?: string;
531
- }) => void;
532
- }) => {
533
- submitAudioResponse: (audio: string) => Promise<{
534
- url: string;
535
- fileName: string;
536
- }>;
537
- uploadAudioAndGetTranscript: (audio: string, language: string) => Promise<{
538
- transcript: string;
539
- audioUrl: string;
540
- }>;
541
- getTranscript: (audioUrl: string, language: string) => Promise<string>;
542
- getFreeResponseCompletion: (messages: string[], isFreeResponse: boolean, feedbackLanguage: string, gradingStandard?: string) => Promise<any>;
543
- getFeedback: ({ cardId, language, writtenResponse, audio, autoGrade, file, }: {
544
- cardId: string;
545
- language: string;
546
- writtenResponse: string | null;
547
- audio: string | null;
548
- autoGrade: boolean;
549
- file: string | null;
550
- }) => Promise<{
551
- noFeedbackAvailable: boolean;
552
- success: boolean;
553
- reason: string;
554
- accessType: "ai_enabled" | "teacher_preview" | "student_with_teacher_plan" | "none";
555
- } | {
556
- noFeedbackAvailable: boolean;
557
- success: boolean;
558
- reason: string;
559
- accessType: string;
560
- aiSuccess: boolean;
561
- }>;
562
- };
563
-
564
- declare const useGoogleClassroom: () => {
565
- submitAssignmentToGoogleClassroom: ({ assignment, scores, googleUserId, }: {
566
- assignment: {
567
- id: string;
568
- name: string;
569
- owners: string[];
570
- courseId: string;
571
- courseWorkId: string;
572
- isAssessment: boolean;
573
- maxPoints: number;
574
- };
575
- scores: Score;
576
- googleUserId?: string | null;
577
- }) => Promise<any>;
578
- };
579
-
580
- declare const cardsQueryKeys: {
581
- all: string[];
582
- one: (params: {
583
- cardId: string;
584
- }) => string[];
585
- };
586
- declare function useCards({ cardIds, enabled, asObject, }: {
587
- cardIds: string[];
588
- enabled: boolean;
589
- asObject?: boolean;
590
- }): {
591
- cards: PageActivityWithId[];
592
- cardsObject: Record<string, PageActivityWithId> | null;
593
- cardsQueries: _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>[];
594
- };
595
- declare function useCreateCard(): {
596
- mutationCreateCard: _tanstack_react_query.UseMutationResult<{
597
- id: string;
598
- } & Partial<PageActivity>, Error, {
599
- data: Partial<PageActivity>;
600
- }, unknown>;
601
- };
602
- declare function useCreateCards(): {
603
- mutationCreateCards: _tanstack_react_query.UseMutationResult<{
604
- id: string;
605
- owners: string[];
606
- checked?: boolean;
607
- completed?: boolean;
608
- media_area_id?: string | null;
609
- media_area_layout?: "left" | "right" | null;
610
- score?: number;
611
- verificationStatus?: VerificationCardStatus;
612
- native_text?: string;
613
- repeat?: number;
614
- language?: string | null;
615
- image?: {
616
- path?: string | null;
617
- url?: string;
618
- };
619
- audio?: {
620
- path?: string | null;
621
- url?: string;
622
- } | null;
623
- notes?: string;
624
- difficulty?: string;
625
- default_language?: string;
626
- target_text?: string;
627
- type: ActivityPageType;
628
- grading_criteria?: string;
629
- scoring_type?: string;
630
- grading_method?: "simple" | "rubric" | "manual" | "standards_based";
631
- feedback_types?: string[];
632
- rubricId?: string;
633
- prompt?: string;
634
- title?: string;
635
- passing_score?: number;
636
- maxCharacters?: number;
637
- answer?: string[];
638
- choices?: {
639
- value: string;
640
- option: string;
641
- }[];
642
- MCQType?: string;
643
- multipleAttemptsAllowed?: boolean;
644
- allowRetries?: boolean;
645
- question?: string;
646
- respondTime?: number;
647
- hidePrompt?: boolean;
648
- videoUrl?: string;
649
- link?: string;
650
- text?: string;
651
- isListenAloud?: boolean;
652
- embedCode?: string;
653
- attempt?: number;
654
- correct?: number;
655
- autoGrade?: boolean;
656
- points?: number;
657
- shuffle?: boolean;
658
- translation?: string;
659
- includeAIContext?: boolean;
660
- media_area_context_ref?: string | null;
661
- standardId?: string;
662
- target_proficiency_level?: string;
663
- allowTTS?: boolean;
664
- feedback_language?: string | null;
665
- correct_answer?: string | null;
666
- limit_attempts?: boolean;
667
- max_attempts?: number;
668
- rich_text?: string;
669
- }[], Error, {
670
- cards: PageActivity[];
671
- }, unknown>;
672
- };
673
- declare function getCardFromCache({ cardId, queryClient, }: {
674
- cardId: string;
675
- queryClient: QueryClient;
676
- }): PageActivityWithId | undefined;
677
- declare function updateCardInCache({ cardId, card, queryClient, }: {
678
- cardId: string;
679
- card: PageActivityWithId | null;
680
- queryClient: QueryClient;
681
- }): void;
682
- declare function useGetCard({ cardId, enabled }: {
683
- cardId: string;
684
- enabled?: boolean;
685
- }): _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>;
686
-
687
- declare const useCreateNotification: () => {
688
- createNotification: (type: SpeakableNotificationType, data: any) => Promise<any>;
689
- };
690
-
691
- declare const setsQueryKeys: {
692
- all: string[];
693
- one: (params: {
694
- setId: string;
695
- }) => string[];
696
- };
697
- declare const useSet: ({ setId, enabled }: {
698
- setId: string;
699
- enabled?: boolean;
700
- }) => _tanstack_react_query.UseQueryResult<SetWithId | null, Error>;
701
- declare function getSetFromCache({ setId, queryClient, }: {
702
- setId: string | undefined;
703
- queryClient: QueryClient;
704
- }): SetWithId | null | undefined;
705
- declare function updateSetInCache({ set, queryClient, }: {
706
- set: SetWithId;
707
- queryClient: QueryClient;
708
- }): void;
709
-
710
- declare function useUserPlan(): {
711
- userPlan: "basic" | "teacher_pro" | "school_starter" | "organization" | "starter" | "growth" | "professional";
712
- loaded: boolean;
713
- isFreePlan: boolean;
714
- isTeacherProPlan: boolean;
715
- isOrganizationPlan: boolean;
716
- isSchoolStarter: boolean;
717
- checkIsFreePlan: (plan: keyof typeof SpeakablePlanTypes) => plan is "basic";
718
- checkIsTeacherProPlan: (plan: keyof typeof SpeakablePlanTypes) => plan is "teacher_pro" | "starter";
719
- checkIsOrganizationPlan: (plan: keyof typeof SpeakablePlanTypes) => plan is "organization" | "growth" | "professional";
720
- };
721
-
722
- interface OrganizationAccess {
723
- hasUnlimitedAccess: boolean;
724
- subscriptionId: string | null;
725
- organizationId: string | null;
726
- organizationName: string | null;
727
- subscriptionEndDate: Date | null;
728
- accessType: 'organization' | 'individual' | 'institution_subscriptions';
729
- }
730
- interface InstitutionSubscription {
731
- id: string;
732
- institutionId: string;
733
- name: string;
734
- plan: string;
735
- endDate: Date;
736
- }
737
- interface Organization {
738
- id: string;
739
- name: string;
740
- members: string[];
741
- masterSubscriptionStatus: string;
742
- masterSubscriptionId: string;
743
- masterSubscriptionEndDate: Date;
744
- }
745
- declare const useOrganizationAccess: () => {
746
- data: OrganizationAccess;
747
- error: Error;
748
- isError: true;
749
- isPending: false;
750
- isLoading: false;
751
- isLoadingError: false;
752
- isRefetchError: true;
753
- isSuccess: false;
754
- isPlaceholderData: false;
755
- status: "error";
756
- dataUpdatedAt: number;
757
- errorUpdatedAt: number;
758
- failureCount: number;
759
- failureReason: Error | null;
760
- errorUpdateCount: number;
761
- isFetched: boolean;
762
- isFetchedAfterMount: boolean;
763
- isFetching: boolean;
764
- isInitialLoading: boolean;
765
- isPaused: boolean;
766
- isRefetching: boolean;
767
- isStale: boolean;
768
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
769
- fetchStatus: _tanstack_react_query.FetchStatus;
770
- promise: Promise<OrganizationAccess>;
771
- } | {
772
- data: OrganizationAccess;
773
- error: null;
774
- isError: false;
775
- isPending: false;
776
- isLoading: false;
777
- isLoadingError: false;
778
- isRefetchError: false;
779
- isSuccess: true;
780
- isPlaceholderData: false;
781
- status: "success";
782
- dataUpdatedAt: number;
783
- errorUpdatedAt: number;
784
- failureCount: number;
785
- failureReason: Error | null;
786
- errorUpdateCount: number;
787
- isFetched: boolean;
788
- isFetchedAfterMount: boolean;
789
- isFetching: boolean;
790
- isInitialLoading: boolean;
791
- isPaused: boolean;
792
- isRefetching: boolean;
793
- isStale: boolean;
794
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
795
- fetchStatus: _tanstack_react_query.FetchStatus;
796
- promise: Promise<OrganizationAccess>;
797
- } | {
798
- data: undefined;
799
- error: Error;
800
- isError: true;
801
- isPending: false;
802
- isLoading: false;
803
- isLoadingError: true;
804
- isRefetchError: false;
805
- isSuccess: false;
806
- isPlaceholderData: false;
807
- status: "error";
808
- dataUpdatedAt: number;
809
- errorUpdatedAt: number;
810
- failureCount: number;
811
- failureReason: Error | null;
812
- errorUpdateCount: number;
813
- isFetched: boolean;
814
- isFetchedAfterMount: boolean;
815
- isFetching: boolean;
816
- isInitialLoading: boolean;
817
- isPaused: boolean;
818
- isRefetching: boolean;
819
- isStale: boolean;
820
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
821
- fetchStatus: _tanstack_react_query.FetchStatus;
822
- promise: Promise<OrganizationAccess>;
823
- } | {
824
- data: undefined;
825
- error: null;
826
- isError: false;
827
- isPending: true;
828
- isLoading: true;
829
- isLoadingError: false;
830
- isRefetchError: false;
831
- isSuccess: false;
832
- isPlaceholderData: false;
833
- status: "pending";
834
- dataUpdatedAt: number;
835
- errorUpdatedAt: number;
836
- failureCount: number;
837
- failureReason: Error | null;
838
- errorUpdateCount: number;
839
- isFetched: boolean;
840
- isFetchedAfterMount: boolean;
841
- isFetching: boolean;
842
- isInitialLoading: boolean;
843
- isPaused: boolean;
844
- isRefetching: boolean;
845
- isStale: boolean;
846
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
847
- fetchStatus: _tanstack_react_query.FetchStatus;
848
- promise: Promise<OrganizationAccess>;
849
- } | {
850
- data: undefined;
851
- error: null;
852
- isError: false;
853
- isPending: true;
854
- isLoadingError: false;
855
- isRefetchError: false;
856
- isSuccess: false;
857
- isPlaceholderData: false;
858
- status: "pending";
859
- dataUpdatedAt: number;
860
- errorUpdatedAt: number;
861
- failureCount: number;
862
- failureReason: Error | null;
863
- errorUpdateCount: number;
864
- isFetched: boolean;
865
- isFetchedAfterMount: boolean;
866
- isFetching: boolean;
867
- isLoading: boolean;
868
- isInitialLoading: boolean;
869
- isPaused: boolean;
870
- isRefetching: boolean;
871
- isStale: boolean;
872
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
873
- fetchStatus: _tanstack_react_query.FetchStatus;
874
- promise: Promise<OrganizationAccess>;
875
- } | {
876
- data: OrganizationAccess;
877
- isError: false;
878
- error: null;
879
- isPending: false;
880
- isLoading: false;
881
- isLoadingError: false;
882
- isRefetchError: false;
883
- isSuccess: true;
884
- isPlaceholderData: true;
885
- status: "success";
886
- dataUpdatedAt: number;
887
- errorUpdatedAt: number;
888
- failureCount: number;
889
- failureReason: Error | null;
890
- errorUpdateCount: number;
891
- isFetched: boolean;
892
- isFetchedAfterMount: boolean;
893
- isFetching: boolean;
894
- isInitialLoading: boolean;
895
- isPaused: boolean;
896
- isRefetching: boolean;
897
- isStale: boolean;
898
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
899
- fetchStatus: _tanstack_react_query.FetchStatus;
900
- promise: Promise<OrganizationAccess>;
901
- };
902
-
903
- declare const useUpdateStudentVocab: (page: PageActivityWithId | null) => {
904
- studentVocabMarkVoiceSuccess: undefined;
905
- studentVocabMarkVoiceFail: undefined;
906
- } | {
907
- studentVocabMarkVoiceSuccess: () => Promise<void>;
908
- studentVocabMarkVoiceFail: () => Promise<void>;
909
- };
910
-
911
- export { type ActivityFeedbackAccess, type InstitutionSubscription, type Organization, type OrganizationAccess, type StudentTeacherPlanResult, activityFeedbackAccessQueryKeys, assignmentQueryKeys, cardsQueryKeys, getCardFromCache, getSetFromCache, scoreQueryKeys, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useActivityFeedbackAccess, useAssignment, useBaseOpenAI, useCards, useClearScore, useCreateCard, useCreateCards, useCreateNotification, useGetCard, useGoogleClassroom, useOrganizationAccess, useScore, useSet, useSubmitAssignmentScore, useSubmitPracticeScore, useUpdateCardScore, useUpdateScore, useUpdateStudentVocab, useUserPlan };