/** * @file Low-level enums with one-to-one mappings to the API */ /** */ declare enum ServiceErrorCode { DOWNSTREAM_SERVICE_ERROR = "DOWNSTREAM_SERVICE_ERROR" } declare enum ServiceErrorName { users = "users" } declare enum UserAccessLevel { COACH = "COACH", PUBLIC = "PUBLIC" } declare enum ProgramEditorType { pjs = "pjs", webpage = "webpage", ace_sql = "ace_sql", unknown = "" } declare enum FeedbackFocusKind { Challenge = "Challenge", Interactive = "Interactive", Project = "Project", Scratchpad = "Scratchpad", Talkthrough = "Talkthrough" } /** * @remarks * Not all feedback types are supported by every query/mutation. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#afc29a01-a4d7-45db-bb1f-82ea66eb210a | Reference} */ declare enum FeedbackType { ALL_PROJECT_ANSWER = "ALL_PROJECT_ANSWER", ALL_PROJECT_QUESTION = "ALL_PROJECT_QUESTION", ANSWER = "ANSWER", COMMENT = "COMMENT", PROGRAM = "PROGRAM", PROJECTFEEDBACK = "PROJECTFEEDBACK", PROJECT_CRITIQUE_ANSWER = "PROJECT_CRITIQUE_ANSWER", PROJECT_CRITIQUE_QUESTION = "PROJECT_CRITIQUE_QUESTION", PROJECT_EVAL_ANSWER = "PROJECT_EVAL_ANSWER", PROJECT_EVAL_QUESTION = "PROJECT_EVAL_QUESTION", PROJECT_HELP_ANSWER = "PROJECT_HELP_ANSWER", PROJECT_HELP_QUESTION = "PROJECT_HELP_QUESTION", QUESTION = "QUESTION", REPLY = "REPLY", SUGGESTED_CLARIFICATION = "SUGGESTED_CLARIFICATION" } declare enum FeedbackTypename { AnswerFeedback = "AnswerFeedback", BasicFeedback = "BasicFeedback", LowQualityFeedback = "LowQualityFeedback", QuestionFeedback = "QuestionFeedback" } declare enum FeedbackSort { TopVoted = 1, Recent = 2, Trending = 5 } declare enum ListProgramSortOrder { TOP = "TOP", RECENT = "RECENT", HOT = "HOT", OFFICIAL = "OFFICIAL", UPVOTE = "UPVOTE", OLDEST = "OLDEST" } type DataResponse = { data: T; }; type ServiceErrorsResponse = { data: unknown; errors: Array<{ extensions: { code: ServiceErrorCode; serviceName: ServiceErrorName; }; message: string; path: Array; }>; }; interface InputErrorResponse { errors: Array<{ message: string; }>; } type StandardResponse = DataResponse | ServiceErrorsResponse | InputErrorResponse; declare function isDataResponse(response: StandardResponse): response is DataResponse; declare function isServiceErrorsResponse(response: StandardResponse): response is ServiceErrorsResponse; declare function isInputErrorResponse(response: StandardResponse): response is InputErrorResponse; declare function assertDataResponse(response: StandardResponse): asserts response is DataResponse; declare const avatarNames: readonly ["blobby_green_style", "blobby_yellow_style", "blobby_blue_style", "blobby_purple_style", "area_52_yellow_style", "area_52_blue_style", "area_52_green_style", "area_52_purple_style", "eggleston_blue_style", "eggleston_yellow_style", "eggleston_green_style", "eggleston_orange_style", "scuttlebug_purple_style", "scuttlebug_yellow_style", "scuttlebug_blue_style", "scuttlebug_green_style", "boggle_yellow_style", "boggle_blue_style", "boggle_green_style", "boggle_purple_style", "sneak_peak_green_style", "sneak_peak_yellow_style", "sneak_peak_blue_style", "sneak_peak_purple_style", "stelly_blue_style", "stelly_yellow_style", "stelly_green_style", "stelly_orange_style", "cacteye_purple_style", "cacteye_yellow_style", "cacteye_blue_style", "cacteye_green_style", "leaf_green_style", "leaf_blue_style", "leaf_grey_style", "leaf_red_style", "leaf_orange_style", "leaf_yellow_style", "leafers_seed_style", "leafers_seedling_style", "leafers_sapling_style", "leafers_tree_style", "leafers_ultimate_style", "piceratops_seed_style", "piceratops_seedling_style", "piceratops_sapling_style", "piceratops_tree_style", "piceratops_ultimate_style", "duskpin_seed_style", "duskpin_seedling_style", "duskpin_sapling_style", "duskpin_tree_style", "duskpin_ultimate_style", "primosaur_seed_style", "primosaur_seedling_style", "primosaur_sapling_style", "primosaur_tree_style", "primosaur_ultimate_style", "starky_seed_style", "starky_seedling_style", "starky_sapling_style", "starky_tree_style", "starky_ultimate_style", "aqualine_seed_style", "aqualine_seedling_style", "aqualine_sapling_style", "aqualine_tree_style", "aqualine_ultimate_style", "spunky_sam_blue_style", "spunky_sam_green_style", "spunky_sam_orange_style", "spunky_sam_red_style", "marcimus_pink_style", "marcimus_orange_style", "marcimus_red_style", "marcimus_purple_style", "mr_pink_red_style", "mr_pink_green_style", "mr_pink_orange_style", "female_robot_amelia_style", "female_robot_ada_style", "female_robot_grace_style", "male_robot_johnny_style", "male_robot_donald_style", "male_robot_hal_style", "orange_juice_squid_orange_style", "purple_pi_purple_style", "purple_pi_pink_style", "purple_pi_teal_style", "mr_pants_teal_style", "mr_pants_green_style", "mr_pants_orange_style", "mr_pants_pink_style", "mr_pants_purple_style", "old_spice_man_green_style", "old_spice_man_blue_style", "winston_default_style", "winston_baby_style", "ohnoes_default_style", "hopper_happy_style", "hopper_jumping_style", "hopper_cool_style"]; declare const avatarSlugs: readonly ["blobby-green", "blobby-yellow", "blobby-blue", "blobby-purple", "area-52-yellow", "area-52-blue", "area-52-green", "area-52-purple", "eggleston-blue", "eggleston-yellow", "eggleston-green", "eggleston-orange", "scuttlebug-purple", "scuttlebug-yellow", "scuttlebug-blue", "scuttlebug-green", "boggle-yellow", "boggle-blue", "boggle-green", "boggle-purple", "sneak-peak-green", "sneak-peak-yellow", "sneak-peak-blue", "sneak-peak-purple", "stelly-blue", "stelly-yellow", "stelly-green", "stelly-orange", "cacteye-purple", "cacteye-yellow", "cacteye-blue", "cacteye-green", "leaf-green", "leaf-blue", "leaf-grey", "leaf-red", "leaf-orange", "leaf-yellow", "leafers-seed", "leafers-seedling", "leafers-sapling", "leafers-tree", "leafers-ultimate", "piceratops-seed", "piceratops-seedling", "piceratops-sapling", "piceratops-tree", "piceratops-ultimate", "duskpin-seed", "duskpin-seedling", "duskpin-sapling", "duskpin-tree", "duskpin-ultimate", "primosaur-seed", "primosaur-seedling", "primosaur-sapling", "primosaur-tree", "primosaur-ultimate", "starky-seed", "starky-seedling", "starky-sapling", "starky-tree", "starky-ultimate", "aqualine-seed", "aqualine-seedling", "aqualine-sapling", "aqualine-tree", "aqualine-ultimate", "spunky-sam", "spunky-sam-green", "spunky-sam-orange", "spunky-sam-red", "marcimus", "marcimus-orange", "marcimus-red", "marcimus-purple", "mr-pink", "mr-pink-green", "mr-pink-orange", "robot_female_1", "robot_female_2", "robot_female_3", "robot_male_1", "robot_male_2", "robot_male_3", "orange-juice-squid", "purple-pi", "purple-pi-pink", "purple-pi-teal", "mr-pants", "mr-pants-green", "mr-pants-orange", "mr-pants-pink", "mr-pants-purple", "old-spice-man", "old-spice-man-blue", "cs-winston", "cs-winston-baby", "cs-ohnoes", "cs-hopper-happy", "cs-hopper-jumping", "cs-hopper-cool"]; declare function avatarNameToSlug(name: AvatarName): "blobby-green" | "blobby-yellow" | "blobby-blue" | "blobby-purple" | "area-52-yellow" | "area-52-blue" | "area-52-green" | "area-52-purple" | "eggleston-blue" | "eggleston-yellow" | "eggleston-green" | "eggleston-orange" | "scuttlebug-purple" | "scuttlebug-yellow" | "scuttlebug-blue" | "scuttlebug-green" | "boggle-yellow" | "boggle-blue" | "boggle-green" | "boggle-purple" | "sneak-peak-green" | "sneak-peak-yellow" | "sneak-peak-blue" | "sneak-peak-purple" | "stelly-blue" | "stelly-yellow" | "stelly-green" | "stelly-orange" | "cacteye-purple" | "cacteye-yellow" | "cacteye-blue" | "cacteye-green" | "leaf-green" | "leaf-blue" | "leaf-grey" | "leaf-red" | "leaf-orange" | "leaf-yellow" | "leafers-seed" | "leafers-seedling" | "leafers-sapling" | "leafers-tree" | "leafers-ultimate" | "piceratops-seed" | "piceratops-seedling" | "piceratops-sapling" | "piceratops-tree" | "piceratops-ultimate" | "duskpin-seed" | "duskpin-seedling" | "duskpin-sapling" | "duskpin-tree" | "duskpin-ultimate" | "primosaur-seed" | "primosaur-seedling" | "primosaur-sapling" | "primosaur-tree" | "primosaur-ultimate" | "starky-seed" | "starky-seedling" | "starky-sapling" | "starky-tree" | "starky-ultimate" | "aqualine-seed" | "aqualine-seedling" | "aqualine-sapling" | "aqualine-tree" | "aqualine-ultimate" | "spunky-sam" | "spunky-sam-green" | "spunky-sam-orange" | "spunky-sam-red" | "marcimus" | "marcimus-orange" | "marcimus-red" | "marcimus-purple" | "mr-pink" | "mr-pink-green" | "mr-pink-orange" | "robot_female_1" | "robot_female_2" | "robot_female_3" | "robot_male_1" | "robot_male_2" | "robot_male_3" | "orange-juice-squid" | "purple-pi" | "purple-pi-pink" | "purple-pi-teal" | "mr-pants" | "mr-pants-green" | "mr-pants-orange" | "mr-pants-pink" | "mr-pants-purple" | "old-spice-man" | "old-spice-man-blue" | "cs-winston" | "cs-winston-baby" | "cs-ohnoes" | "cs-hopper-happy" | "cs-hopper-jumping" | "cs-hopper-cool"; declare function avatarSlugToName(slug: AvatarSlug): "blobby_green_style" | "blobby_yellow_style" | "blobby_blue_style" | "blobby_purple_style" | "area_52_yellow_style" | "area_52_blue_style" | "area_52_green_style" | "area_52_purple_style" | "eggleston_blue_style" | "eggleston_yellow_style" | "eggleston_green_style" | "eggleston_orange_style" | "scuttlebug_purple_style" | "scuttlebug_yellow_style" | "scuttlebug_blue_style" | "scuttlebug_green_style" | "boggle_yellow_style" | "boggle_blue_style" | "boggle_green_style" | "boggle_purple_style" | "sneak_peak_green_style" | "sneak_peak_yellow_style" | "sneak_peak_blue_style" | "sneak_peak_purple_style" | "stelly_blue_style" | "stelly_yellow_style" | "stelly_green_style" | "stelly_orange_style" | "cacteye_purple_style" | "cacteye_yellow_style" | "cacteye_blue_style" | "cacteye_green_style" | "leaf_green_style" | "leaf_blue_style" | "leaf_grey_style" | "leaf_red_style" | "leaf_orange_style" | "leaf_yellow_style" | "leafers_seed_style" | "leafers_seedling_style" | "leafers_sapling_style" | "leafers_tree_style" | "leafers_ultimate_style" | "piceratops_seed_style" | "piceratops_seedling_style" | "piceratops_sapling_style" | "piceratops_tree_style" | "piceratops_ultimate_style" | "duskpin_seed_style" | "duskpin_seedling_style" | "duskpin_sapling_style" | "duskpin_tree_style" | "duskpin_ultimate_style" | "primosaur_seed_style" | "primosaur_seedling_style" | "primosaur_sapling_style" | "primosaur_tree_style" | "primosaur_ultimate_style" | "starky_seed_style" | "starky_seedling_style" | "starky_sapling_style" | "starky_tree_style" | "starky_ultimate_style" | "aqualine_seed_style" | "aqualine_seedling_style" | "aqualine_sapling_style" | "aqualine_tree_style" | "aqualine_ultimate_style" | "spunky_sam_blue_style" | "spunky_sam_green_style" | "spunky_sam_orange_style" | "spunky_sam_red_style" | "marcimus_pink_style" | "marcimus_orange_style" | "marcimus_red_style" | "marcimus_purple_style" | "mr_pink_red_style" | "mr_pink_green_style" | "mr_pink_orange_style" | "female_robot_amelia_style" | "female_robot_ada_style" | "female_robot_grace_style" | "male_robot_johnny_style" | "male_robot_donald_style" | "male_robot_hal_style" | "orange_juice_squid_orange_style" | "purple_pi_purple_style" | "purple_pi_pink_style" | "purple_pi_teal_style" | "mr_pants_teal_style" | "mr_pants_green_style" | "mr_pants_orange_style" | "mr_pants_pink_style" | "mr_pants_purple_style" | "old_spice_man_green_style" | "old_spice_man_blue_style" | "winston_default_style" | "winston_baby_style" | "ohnoes_default_style" | "hopper_happy_style" | "hopper_jumping_style" | "hopper_cool_style"; /** * Generates a URL to an avatar SVG */ declare function generateAvatarSVG(slug: AvatarSlug): AvatarSVG; /** * Generates a URL to an avatar PNG */ declare function generateAvatarPNG(slug: AvatarSlug): AvatarPNG; /** * Extracts the avatar slug from a path or URL * * @param path Relative or absolute path to an avatar * @returns The avatar slug if the path is valid, null otherwise * * @example * extractAvatarSlug('/images/avatars/blobby-green.svg') // 'blobby-green' * * @example * extractAvatarSlug('https://www.khanacademy.org/images/avatars/svg/blobby-green.svg') // 'blobby-green' * * @example * extractAvatarSlug('https://www.khanacademy.org/images/avatars/blobby-green.png') // 'blobby-green' */ declare function extractAvatarSlug(path: AvatarPath | AvatarURL): AvatarSlug | null; declare function convertAvatarSVGToPNG(url: AvatarSVG): AvatarPNG | null; declare function convertAvatarPNGToSVG(url: AvatarPNG): AvatarSVG | null; declare const URL_TLDS: readonly ["com", "org"]; declare const URL_LOCALES: readonly ["as", "az", "cs", "da", "el", "gu", "hu", "id", "it", "lt", "ja", "kk", "kn", "ky", "lv", "mn", "mr", "my", "nl", "pt-pt", "ru", "sv", "ta", "uz", "bg", "bn", "de", "en", "es", "fr", "hi", "hy", "ka", "km", "ko", "nb", "pa", "pl", "pt", "ro", "sr", "tr", "vi", "zh-hans", "sgn-us"]; declare const KaidRegex: RegExp; declare const KaidRegexMatch: RegExp; declare const isKaid: (str: string) => str is Kaid; declare const UserURLRegex: RegExp; declare const UserURLRegexMatch: RegExp; declare const isUserURL: (str: string) => str is UserURL; declare const PROGRAM_ID_LENGTHS: readonly [9, 10, 16]; declare const ProgramIDRegex: RegExp; declare const ProgramIDRegexMatch: RegExp; declare function isProgramID(strOrNum: string | number): strOrNum is ProgramID; declare const PROGRAM_URL_PATHS: readonly ["computer-programming", "cs", "pixar", "nasa", "piab-sandbox", "computer-science", "hour-of-code", "math", "differential-equations", "electrical-engineering", "mcat", "apchem-topic", "chemistry", "art-history-basics", "biology"]; declare const ProgramURLRegex: RegExp; declare const ProgramURLRegexMatch: RegExp; declare function isProgramURL(str: string): str is ProgramURL; declare const ProgramImagePathRegex: RegExp; declare const ProgramImagePathRegexMatch: RegExp; declare const PROGRAM_KEY_LENGTHS: readonly [51, 54]; declare const ProgramKeyRegex: RegExp; declare const ProgramKeyRegexMatch: RegExp; /** * Checks if a string is a valid program key * * @remarks * This function will only check the format of the string and not the existence * of the program on Khan Academy. * * Program keys are not the same format as lesson keys or other keys * that may look similar at first glance. * * This function has been tested against more than 1,000,000 program keys but it * is possible that in the future, new program key formats will be introduced. */ declare function isProgramKey(str: string): str is ProgramKey; declare const MESSAGE_KEY_LENGTHS: readonly [106, 107, 108, 110, 111]; declare const FeedbackKeyRegex: RegExp; declare const FeedbackKeyRegexMatch: RegExp; declare const isFeedbackKey: (str: string) => str is FeedbackKey; declare const MESSAGE_ENCRYPTED_KEY_LENGTHS: readonly [301]; declare const MessageEncryptedKeyRegex: RegExp; declare const MessageEncryptedKeyRegexMatch: RegExp; declare const isEncryptedFeedbackKey: (str: string) => str is EncryptedFeedbackKey; declare const GoogleIDRegex: RegExp; declare const GoogleIDRegexMatch: RegExp; declare const isGoogleID: (str: string) => str is GoogleID; declare const QualarooIDRegex: RegExp; declare const QualarooIDRegexMatch: RegExp; declare const isQualarooID: (str: string) => str is QualarooID; declare const EmailRegex: RegExp; declare const EmailRegexMatch: RegExp; declare const isEmail: (str: string) => str is Email; /** * @file Low-level string types with one-to-one mappings to the API */ type Email = `${string}@${string}.${string}`; type Locale = (typeof URL_LOCALES)[number]; type Kaid = `kaid_${number}`; type QualarooID = `_gae_bingo_random:${string}`; type GoogleID = `http://googleid.khanacademy.org/${number}`; type UserURL = `http${string}://${string}khanacademy.${string}/profile/${string}`; type AvatarName = (typeof avatarNames)[number]; type AvatarSlug = (typeof avatarSlugs)[number]; type AvatarPath = `/images/avatars/svg/${AvatarSlug}.svg`; type AvatarSVG = `https://www.khanacademy.org${AvatarPath}`; type AvatarPNG = `https://www.khanacademy.org/images/avatars/${AvatarSlug}.png`; type AvatarURL = AvatarSVG | AvatarPNG; type ProgramIDString = `${number}`; type ProgramIDNumber = number; type ProgramID = `${number}` | number; type ProgramURLPath = (typeof PROGRAM_URL_PATHS)[number]; type ProgramURL = `http${string}://${string}khanacademy.${string}/${string}/${string}/${number}`; type ProgramKey = `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}`; type FeedbackKey = `ag5zfmtoYW4tYWNhZGVteX${string}CxIIVXNlckRhdGEi${string}thaWRf${string}${string}${string}`; type EncryptedFeedbackKey = `kaencrypted_${string}_${string}`; /** * @file GraphQL Schema * * @summary * This file contains the GraphQL schema types for the KA API. * * @description * This file exists to reduce code duplication and because GraphQL operates using schemas. * * Khan Academy's safelisted GraphQL queries will usually not request any schema entirely so TypeScript's `Pick` and `Omit` utility types may come in handy. */ interface UserSchema { __typename: 'User'; actorHasUserScopedPermission: boolean; authEmails: Array | null; autocontinueOn: boolean | null; avatar: AvatarData; badgeCounts: string; bio: string; birthMonthYear: null | unknown; canAccessDistrictsHomepage: boolean; canHellban: boolean | null; canMessageUsers: boolean | null; canModifyCoaches: boolean | null; countVideosCompleted: number; email: string | null; gaUserId: string | null; hasAccessToAIGuideDev: boolean | null; hasAccessToAIGuideCompanionMode: boolean | null; hasAccessToAIGuideDistrictAdmin: boolean | null; hasAccessToAIGuideLearner: boolean | null; hasAccessToAIGuideParent: boolean | null; hasAccessToAIGuideTeacher: boolean | null; hasChildren: boolean | null; hasClasses: boolean | null; hasCoach: boolean | null; hasStudents: boolean | null; hasUnresolvedInvitations: boolean | null; hideVisual: boolean | null; homepageUrl: string | null; /** * Same as KAID unless the user is anonymous */ id: Kaid | null; includesDistrictOwnedData: boolean; includesK4dDistrictOwnedData: boolean; includesKmapDistrictOwnedData: boolean; isAIGuideEnabled: boolean; isActor: boolean; isChild: boolean | null; isCoachedByActor: boolean; isCoachingLoggedInUser: boolean; isCreator: boolean | null; isCurator: boolean | null; isDataCollectible: boolean | null; isDeveloper: boolean | null; isFormalTeacher: boolean | null; isK4dStudent: boolean | null; isKmapStudent: boolean | null; isMidsignupPhantom: boolean; isModerator: boolean | null; isOrphan: boolean | null; isParent: boolean | null; isPhantom: boolean; isPublisher: boolean | null; isSatStudent: boolean | null; isSelf: boolean; isTeacher: boolean | null; joined: string; /** * Will always be a string if requested in the GraphQL query. Defaults to empty string (`''`) for anonymous users. */ kaid: Kaid | ''; key: string | null; lastLoginCountry: string | null; muteVideos: boolean | null; newNotificationCount: number | null; nickname: string | null; noColorInVideos: boolean | null; pendingEmailVerifications: PendingEmailVerificationSchema[] | null; points: number; preferredKaLocale: LocaleSchema | null; prefersReducedMotion: boolean | null; profile: ProfileData; /** * Defaults to `null` for anonymous users. */ profileRoot: `/profile/${string}/` | null; programs: ListProgramsData; /** * Either Qualaroo ID or KAID * * @link https://github.com/kamens/gae_bingo * * @deprecated Since 2023-04-24 */ qualarooId: QualarooID | Kaid | null; region: null | unknown; shouldShowAgeCheck: boolean | null; showCaptions: boolean | null; signupDataIfUnverified: null | unknown; soundOn: boolean | null; tosAccepted: boolean | null; transferAuthToken: string; underAgeGate: null | unknown; /** * Either Google ID or KAID */ userId: GoogleID | Kaid; userSummaryIsVisibleToActor: boolean; username: string; } interface AvatarSchema { __typename: 'Avatar'; category: string; /** * For example: * `"/images/avatars/svg/blobby-green.svg"` */ imageSrc: AvatarPath; isDefaultForCategory: boolean; name: AvatarName; } interface PendingEmailVerificationSchema { __typename: 'PendingEmailVerification'; email: string; } interface LocaleSchema { __typename: 'Locale'; id: string; kaLocale: Locale; status: null | unknown; } interface ProfileSchema { __typename: 'Profile'; accessLevel: UserAccessLevel; programs: Pick[]; } interface ListProgramsSchema { __typename: 'ListPrograms'; complete: boolean; cursor: string; programs: ProgramData[]; } interface UserSummarySchema { __typename: 'UserSummary'; statistics: UserStatisticsSchema; } interface UserStatisticsSchema { __typename: 'UserStatistics'; answers: number; comments: number; flags: number; projectanswers: number; projectquestions: number; questions: number; replies: number; votes: number; } interface ProgramSchema { __typename: 'Program'; authorKaid: UserSchema['kaid']; authorNickname: UserSchema['nickname']; byChild: boolean; category: null | unknown; created: string; creatorProfile: UserData; deleted: boolean | null; description: string; displayableSpinoffCount: number; docsUrlPath: string; flaggedBy: null | unknown; flaggedByUser: boolean; /** * Required special permissions. */ flags: null | unknown; height: number; hideFromHotlist: boolean; id: `${number}`; imagePath: string; isOwner: boolean; isProjectOrFork: boolean; kaid: UserSchema['kaid']; key: ProgramKey; newUrlPath: string; originScratchpad: OriginProgramSchema | null; restrictPosting: boolean; revision: ProgramRevisionSchema; slug: string; spinoffCount: number; sumVotesIncremented: number; title: string; topic: TopicSchema; translatedTitle: string; upVoted: boolean; url: string; /** * Besides `PJS`, `WEBPAGE` and `SQL` it can also be an arbitrary string */ userAuthoredContentType: string; width: number; } interface OriginProgramSchema { __typename: 'OriginProgram'; deleted: boolean; translatedTitle: string; url: string; } interface ProgramRevisionSchema { __typename: 'ProgramRevision'; code: string; configVersion: number; created: string; editorType: ProgramEditorType; folds: Array<[number, number]>; id: string; } interface TopicSchema { __typename: 'Topic'; id: string; nodeSlug: string; relativeUrl: string; slug: string; translatedTitle: string; } interface FeedbackForFocusSchema { __typename: 'FeedbackForFocus'; cursor: string | null; feedback: BasicFeedbackSchema[] | QuestionFeedbackSchema[] | AnswerFeedbackSchema[] | null; isComplete: boolean; sortedByDate: boolean; } interface FeedbackSchemaBase { __typename: FeedbackTypename; appearsAsDeleted: boolean; author: Pick>, '__typename' | 'avatar' | 'id' | 'kaid' | 'nickname'>; /** * Always `null` */ badges: null | unknown; content: string; date: string; definitelyNotSpam: boolean; deleted: boolean; downVoted: boolean; expandKey: string; feedbackType: FeedbackType; /** * Always `null` */ flaggedBy: null | unknown; flaggedByUser: boolean; /** * Always `null` */ flags: null | unknown; focus: FeedbackFocusSchema; focusUrl: string; fromVideoAuthor: boolean; isLocked: boolean; isPinned: boolean; /** * Encrypted ID */ key: string; lowQualityScore: number; notifyOnAnswer: boolean; permalink: string; qualityKind: string; replyCount: number; /** * Expand keys for parent feedback. Always 1-2 elements */ replyExpandKeys: Array | FeedbackKey; /** * Always `false`? May depend on the user */ showLowQualityNotice: boolean; sumVotesIncremented: number; upVoted: boolean; } interface FeedbackFocusSchema { __typename: 'FeedbackFocus'; id: string; kind: FeedbackFocusKind; relativeUrl: string; translatedTitle: string; } interface BasicFeedbackSchema extends FeedbackSchemaBase { __typename: FeedbackTypename; feedbackType: FeedbackType.COMMENT | FeedbackType.REPLY; } interface QuestionFeedbackSchema extends FeedbackSchemaBase { __typename: FeedbackTypename.QuestionFeedback; answerCount: number; answers: Pick[] | null; feedbackType: FeedbackType.QUESTION | FeedbackType.PROJECT_HELP_QUESTION; /** * Always `null` */ hasAnswered: null | unknown; isOld: boolean; } interface AnswerFeedbackSchema extends FeedbackSchemaBase { __typename: FeedbackTypename.AnswerFeedback; feedbackType: FeedbackType.ANSWER; question: Pick; } interface QaExpandKeyInfoSchema { __typename: 'QaExpandKeyInfo'; feedbackType: FeedbackType; unencryptedKey: FeedbackKey; } interface RepliesSchema { __typename: 'Replies'; cursor: string | null; feedback: BasicFeedbackSchema[] | null; isComplete: boolean; } interface TypedResponse extends Response { json(): Promise; } declare function http(url: string, init?: RequestInit): Promise>; declare function get(url: string, init?: RequestInit): Promise>; declare function post(url: string, body: Record, init?: RequestInit): Promise>; declare function graphql(url: string, query: string, variables?: Variables, init?: RequestInit): Promise>; declare namespace AvatarDataForProfile { const query = "query avatarDataForProfile($kaid: String!) {\n user(kaid: $kaid) {\n id\n avatar {\n name\n imageSrc\n __typename\n }\n __typename\n }\n}"; interface Variables { kaid: Kaid; } type Response = StandardResponse; type Data = { user: Pick>, '__typename' | 'avatar' | 'id' | 'kaid'> | null; }; } /** * Low-level function for making a `avatarDataForProfile` request. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#256c194a-f6d5-4c7a-aaa5-97792cdba1b3 | Reference} * * @example * Simple usage without error handling: * ```js * const response = await queries.avatarDataForProfile({ * kaid: 'kaid_326465577260382527912172' * }) * const json = await response.json() * const profile = json.data.user * const avatar = profile.avatar * ``` */ declare function avatarDataForProfile(variables: AvatarDataForProfile.Variables, init?: RequestInit): Promise>; /** * @example * Alternative usage: * ```js * const response = await queries.avatarDataForProfile('kaid_326465577260382527912172') * const json = await response.json() * const profile = json.data.user * const avatar = profile.avatar * ``` */ declare function avatarDataForProfile(kaid: Kaid, init?: RequestInit): Promise>; declare namespace FeedbackQuery { const query = "query feedbackQuery($topicId: String!, $focusKind: String!, $cursor: String, $limit: Int, $feedbackType: FeedbackType!, $currentSort: Int, $qaExpandKey: String) {\n feedback(\n focusId: $topicId\n cursor: $cursor\n limit: $limit\n feedbackType: $feedbackType\n focusKind: $focusKind\n sort: $currentSort\n qaExpandKey: $qaExpandKey\n answersLimit: 1\n ) {\n feedback {\n isLocked\n isPinned\n replyCount\n appearsAsDeleted\n author {\n id\n kaid\n nickname\n avatar {\n name\n imageSrc\n __typename\n }\n __typename\n }\n badges {\n name\n icons {\n smallUrl\n __typename\n }\n description\n __typename\n }\n content\n date\n definitelyNotSpam\n deleted\n downVoted\n expandKey\n feedbackType\n flaggedBy\n flaggedByUser\n flags\n focusUrl\n focus {\n kind\n id\n translatedTitle\n relativeUrl\n __typename\n }\n fromVideoAuthor\n key\n lowQualityScore\n notifyOnAnswer\n permalink\n qualityKind\n replyCount\n replyExpandKeys\n showLowQualityNotice\n sumVotesIncremented\n upVoted\n ... on QuestionFeedback {\n hasAnswered\n answers {\n isLocked\n isPinned\n replyCount\n appearsAsDeleted\n author {\n id\n kaid\n nickname\n avatar {\n name\n imageSrc\n __typename\n }\n __typename\n }\n badges {\n name\n icons {\n smallUrl\n __typename\n }\n description\n __typename\n }\n content\n date\n definitelyNotSpam\n deleted\n downVoted\n expandKey\n feedbackType\n flaggedBy\n flaggedByUser\n flags\n focusUrl\n focus {\n kind\n id\n translatedTitle\n relativeUrl\n __typename\n }\n fromVideoAuthor\n key\n lowQualityScore\n notifyOnAnswer\n permalink\n qualityKind\n replyCount\n replyExpandKeys\n showLowQualityNotice\n sumVotesIncremented\n upVoted\n __typename\n }\n isOld\n answerCount\n __typename\n }\n ... on AnswerFeedback {\n question {\n isLocked\n isPinned\n replyCount\n appearsAsDeleted\n author {\n id\n kaid\n nickname\n avatar {\n name\n imageSrc\n __typename\n }\n __typename\n }\n badges {\n name\n icons {\n smallUrl\n __typename\n }\n description\n __typename\n }\n content\n date\n definitelyNotSpam\n deleted\n downVoted\n expandKey\n feedbackType\n flaggedBy\n flaggedByUser\n flags\n focusUrl\n focus {\n kind\n id\n translatedTitle\n relativeUrl\n __typename\n }\n fromVideoAuthor\n key\n lowQualityScore\n notifyOnAnswer\n permalink\n qualityKind\n replyCount\n replyExpandKeys\n showLowQualityNotice\n sumVotesIncremented\n upVoted\n __typename\n }\n __typename\n }\n __typename\n }\n cursor\n isComplete\n sortedByDate\n __typename\n }\n}"; interface Variables { topicId: string; focusKind: FeedbackFocusKind; cursor?: string; limit?: number; feedbackType: FeedbackType; currentSort: FeedbackSort | number | null; qaExpandKey?: string | null; } type Response = StandardResponse; type Data = { feedback: FeedbackForFocusSchema; }; } /** * Low-level for making a `feedbackQuery` request. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#e7abb177-fe2b-4e49-a003-5f9be43b90e4 | Reference} */ declare function feedbackQuery(variables: FeedbackQuery.Variables, init?: RequestInit): Promise>; declare namespace GetFeedbackReplies { const query = "query getFeedbackReplies($postKey: String!) {\n feedbackReplies(feedbackKey: $postKey) {\n isLocked\n isPinned\n expandKey\n appearsAsDeleted\n author {\n id\n kaid\n nickname\n avatar {\n name\n imageSrc\n __typename\n }\n __typename\n }\n content\n date\n definitelyNotSpam\n deleted\n downVoted\n expandKey\n feedbackType\n flaggedBy\n flaggedByUser\n flags\n focusUrl\n fromVideoAuthor\n key\n lowQualityScore\n notifyOnAnswer\n permalink\n qualityKind\n replyCount\n replyExpandKeys\n showLowQualityNotice\n sumVotesIncremented\n upVoted\n __typename\n }\n}"; interface Variables { postKey: FeedbackKey | EncryptedFeedbackKey; } type Response = StandardResponse; type Data = { feedbackReplies: Pick[]; }; } /** * Low-level function for making a `getFeedbackReplies` request. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#3d616591-a38f-4bec-9836-367dba32a2ac | Reference} * * @example * Simple usage without error handling: * ```js * const response = await queries.getFeedbackReplies({ * postKey: 'ag5zfmtoYW4tYWNhZGVteXJBCxIIVXNlckRhdGEiHmthaWRfNjYzMzc5NDA2ODA0Nzc0MjA1NjU0NTUzNAwLEghGZWVkYmFjaxiAgOPjx8-XCAw' * }) * const json = await response.json() * const replies = json.data.feedbackReplies * ``` */ declare function getFeedbackReplies(variables: GetFeedbackReplies.Variables, init?: RequestInit): Promise>; /** * @example * Alternative usage: * ```js * const await queries.getFeedbackReplies('ag5zfmtoYW4tYWNhZGVteXJBCxIIVXNlckRhdGEiHmthaWRfNjYzMzc5NDA2ODA0Nzc0MjA1NjU0NTUzNAwLEghGZWVkYmFjaxiAgOPjx8-XCAw') * const json = await response.json() * const replies = json.data.feedbackReplies * ``` */ declare function getFeedbackReplies(postKey: FeedbackKey | EncryptedFeedbackKey, init?: RequestInit): Promise>; declare namespace GetFeedbackRepliesPage { const query = "query getFeedbackRepliesPage($postKey: String!, $cursor: String, $limit: Int!) {\n feedbackRepliesPaginated(feedbackKey: $postKey, cursor: $cursor, limit: $limit) {\n cursor\n isComplete\n feedback {\n isLocked\n isPinned\n expandKey\n appearsAsDeleted\n author {\n id\n kaid\n nickname\n avatar {\n name\n imageSrc\n __typename\n }\n __typename\n }\n content\n date\n definitelyNotSpam\n deleted\n downVoted\n expandKey\n feedbackType\n flaggedBy\n flaggedByUser\n flags\n focusUrl\n fromVideoAuthor\n key\n lowQualityScore\n notifyOnAnswer\n permalink\n qualityKind\n replyCount\n replyExpandKeys\n showLowQualityNotice\n sumVotesIncremented\n upVoted\n __typename\n }\n __typename\n }\n}"; interface Variables { postKey: FeedbackKey | EncryptedFeedbackKey; cursor?: string | null; limit: number; } type Response = StandardResponse; type Data = { feedbackRepliesPaginated: RepliesSchema; }; } /** * Low-level function to fetch a page of replies to a feedback post. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#16b92467-dd37-4dbb-968a-cb700ae0f9cb | Reference} */ declare function getFeedbackRepliesPage(variables: GetFeedbackRepliesPage.Variables, init?: RequestInit): Promise>; declare namespace GetFullUserProfile { const query = "query getFullUserProfile($kaid: String, $username: String) {\n user(kaid: $kaid, username: $username) {\n id\n kaid\n key\n userId\n email\n username\n profileRoot\n gaUserId\n isPhantom\n isDeveloper: hasPermission(name: \"can_do_what_only_admins_can_do\")\n isPublisher: hasPermission(name: \"can_publish\", scope: ANY_ON_CURRENT_LOCALE)\n isModerator: hasPermission(name: \"can_moderate_users\", scope: GLOBAL)\n isParent\n isTeacher\n isFormalTeacher\n isK4dStudent\n isKmapStudent\n isDataCollectible\n isChild\n isOrphan\n isCoachingLoggedInUser\n canModifyCoaches\n nickname\n hideVisual\n joined\n points\n countVideosCompleted\n bio\n profile {\n accessLevel\n __typename\n }\n soundOn\n muteVideos\n showCaptions\n prefersReducedMotion\n noColorInVideos\n newNotificationCount\n canHellban: hasPermission(name: \"can_ban_users\", scope: GLOBAL)\n canMessageUsers: hasPermission(\n name: \"can_send_moderator_messages\"\n scope: GLOBAL\n )\n isSelf: isActor\n hasStudents: hasCoachees\n hasClasses\n hasChildren\n hasCoach\n badgeCounts\n homepageUrl\n isMidsignupPhantom\n includesDistrictOwnedData\n includesKmapDistrictOwnedData\n includesK4dDistrictOwnedData\n canAccessDistrictsHomepage\n underAgeGate {\n parentEmail\n daysUntilCutoff\n approvalGivenAt\n __typename\n }\n authEmails\n signupDataIfUnverified {\n email\n emailBounced\n __typename\n }\n pendingEmailVerifications {\n email\n __typename\n }\n hasAccessToAIGuideCompanionMode\n hasAccessToAIGuideLearner\n hasAccessToAIGuideDistrictAdmin\n hasAccessToAIGuideParent\n hasAccessToAIGuideTeacher\n tosAccepted\n shouldShowAgeCheck\n birthMonthYear\n lastLoginCountry\n region\n userDistrictInfos {\n id\n isKAD\n district {\n id\n region\n __typename\n }\n __typename\n }\n schoolAffiliation {\n id\n location\n __typename\n }\n __typename\n }\n actorIsImpersonatingUser\n isAIGuideEnabled\n hasAccessToAIGuideDev\n}"; interface Variables { kaid?: Kaid | null; username?: string | null; } type Response = StandardResponse; type Data = { actorIsImpersonatingUser: boolean; user: Pick>, '__typename' | 'authEmails' | 'badgeCounts' | 'birthMonthYear' | 'bio' | 'canAccessDistrictsHomepage' | 'canHellban' | 'canMessageUsers' | 'canModifyCoaches' | 'countVideosCompleted' | 'email' | 'gaUserId' | 'hasAccessToAIGuideDev' | 'hasAccessToAIGuideCompanionMode' | 'hasAccessToAIGuideDistrictAdmin' | 'hasAccessToAIGuideLearner' | 'hasAccessToAIGuideParent' | 'hasAccessToAIGuideTeacher' | 'hasChildren' | 'hasClasses' | 'hasCoach' | 'hasStudents' | 'hideVisual' | 'homepageUrl' | 'id' | 'includesDistrictOwnedData' | 'includesK4dDistrictOwnedData' | 'includesKmapDistrictOwnedData' | 'isAIGuideEnabled' | 'isChild' | 'isCoachingLoggedInUser' | 'isCreator' | 'isCurator' | 'isDataCollectible' | 'isDeveloper' | 'isFormalTeacher' | 'isK4dStudent' | 'isKmapStudent' | 'isMidsignupPhantom' | 'isModerator' | 'isOrphan' | 'isParent' | 'isPhantom' | 'isPublisher' | 'isSelf' | 'isTeacher' | 'joined' | 'kaid' | 'key' | 'lastLoginCountry' | 'muteVideos' | 'newNotificationCount' | 'nickname' | 'noColorInVideos' | 'pendingEmailVerifications' | 'points' | 'prefersReducedMotion' | 'profile' | 'profileRoot' | 'region' | 'shouldShowAgeCheck' | 'showCaptions' | 'signupDataIfUnverified' | 'soundOn' | 'tosAccepted' | 'underAgeGate' | 'userId' | 'username'> | null; }; } /** * Low-level function for making a `getFullUserProfile` request. * * @remarks * This request does not require authentication but some fields will be returned * as `null`. * * If, for some reason, both `kaid` and `username` are provided, Khan Academy * will use `kaid` and ignore `username`. * * @param variables Fetches profile associated with any cookies if not provided * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#9ae4c690-be8a-4b57-acfc-07a4870a5ee3 | Reference} * * @see {@link Client.getUser} * * @example * Get profile by KAID, without error handling: * ```js * const response = await queries.getFullUserProfile({ kaid: 'kaid_326465577260382527912172' }) * const json = await response.json() * const profile = json.data.user * ``` * * @example * Similarly, get profile by username: * ```js * const response = await queries.getFullUserProfile({ username: 'sal' }) * const json = await response.json() * const profile = json.data.user * ``` * * @example * If no variables are provided or an empty object is passed in, Khan Academy * will use any cookies included with the request to fetch the profile * associated with them: * ```js * const response = await queries.getFullUserProfile(null, { * headers: { cookie: 'KAAS=...' } * }) * const json = await response.json() * const profile = json.data.user * ``` */ declare function getFullUserProfile(variables?: GetFullUserProfile.Variables, init?: RequestInit): Promise>; /** * @example * Alternative usage by KAID: * ```js * const response = await queries.getFullUserProfile('kaid_326465577260382527912172') * const json = await response.json() * const profile = json.data.user * ``` */ declare function getFullUserProfile(kaid?: Kaid, init?: RequestInit): Promise>; /** * @example * Similarly, by username: * ```js * const response = await queries.getFullUserProfile('sal') * const json = await response.json() * const profile = json.data.user * ``` */ declare function getFullUserProfile(username?: string, init?: RequestInit): Promise>; declare namespace GetProfileWidgets { const query = "query getProfileWidgets($kaid: String!) {\n user(kaid: $kaid) {\n id\n kaid\n badgeCounts\n isChild\n profile {\n programs {\n id\n authorKaid\n authorNickname\n deleted\n displayableSpinoffCount\n imagePath\n key\n sumVotesIncremented\n translatedTitle: title\n url\n __typename\n }\n __typename\n }\n programs(sort: TOP, pageInfo: {itemsPerPage: 2}) {\n programs {\n id\n authorKaid\n authorNickname\n deleted\n displayableSpinoffCount\n imagePath\n key\n sumVotesIncremented\n translatedTitle: title\n url\n __typename\n }\n __typename\n }\n __typename\n }\n userSummary(kaid: $kaid) {\n statistics {\n answers\n comments\n flags\n projectanswers\n projectquestions\n questions\n replies\n votes\n __typename\n }\n __typename\n }\n}"; interface Variables { kaid: Kaid; } type Response = StandardResponse; type Data = { user: Pick, ListProgramsSchema & { translatedTitle: ProgramSchema['title']; }>>, '__typename' | 'badgeCounts' | 'id' | 'isChild' | 'kaid' | 'profile' | 'programs'>; /** * Will still be defined even if the user doesn't exist, but all values will be 0 */ userSummary: UserSummarySchema; }; } /** * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#d88fe317-8705-43d7-a811-5d93316dd4a2 | Reference} */ declare function getProfileWidgets(variables: GetProfileWidgets.Variables, init?: RequestInit): Promise>; declare function getProfileWidgets(kaid: Kaid, init?: RequestInit): Promise>; declare namespace GetUserByUsernameOrEmail { const query = "query getUserByUsernameOrEmail($username: String, $email: String) {\n user(username: $username, email: $email) {\n id\n kaid\n __typename\n }\n}"; interface Variables { username?: string; email?: string; } type Response = StandardResponse; type Data = { user: Pick | null; }; } /** * Get KAID by username or email. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#46e24c10-e98e-4900-bd53-b02d93f8e3c9 | Reference} * * @example * Simple usage without error handling: * ```js * const response = await queries.getUserByUsernameOrEmail({ * username: 'sal' * }) * const json = await response.json() * const kaid = json.data.user?.kaid * ``` * * @example * Similarly, get KAID by email: * ```js * const response = await queries.getUserByUsernameOrEmail({ * email: 'sal@khanacademy.org' * }) * const json = await response.json() * const kaid = json.data.user?.kaid * ``` */ declare function getUserByUsernameOrEmail(variables: GetUserByUsernameOrEmail.Variables, init?: RequestInit): Promise>; /** * @example * Alternative usage by username: * ```js * const response = await queries.getUserByUsernameOrEmail('sal') * const json = await response.json() * const kaid = json.data.user?.kaid * ``` */ declare function getUserByUsernameOrEmail(username: string, init?: RequestInit): Promise>; /** * @example * Similarly, by email: * ```js * const response = await queries.getUserByUsernameOrEmail('sal@khanacademy.org') * const json = await response.json() * const kaid = json.data.user?.kaid * ``` */ declare function getUserByUsernameOrEmail(email: Email, init?: RequestInit): Promise>; declare namespace GetUserHoverCardProfile { const query = "query getUserHoverCardProfile($kaid: String!) {\n user(kaid: $kaid) {\n id\n nickname\n username\n bio\n avatar {\n name\n imageSrc\n __typename\n }\n points\n isPhantom\n isActor\n isCoachedByActor\n userSummaryIsVisibleToActor\n actorHasUserScopedPermission(capability: CAN_VIEW_USER_IDENTITY)\n __typename\n }\n}"; interface Variables { kaid: Kaid; } type Response = StandardResponse; type Data = { user: Pick>, '__typename' | 'actorHasUserScopedPermission' | 'avatar' | 'bio' | 'id' | 'isActor' | 'isCoachedByActor' | 'isPhantom' | 'kaid' | 'nickname' | 'points' | 'userSummaryIsVisibleToActor' | 'username'> | null; }; } /** * Low-level function for making a `getUserHoverCardProfile` request. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#6de1d62b-d8b4-425e-b0f2-305be6279718 | Reference} * * @example * Simple usage without error handling: * ```js * const response = await queries.getUserHoverCardProfile({ * kaid: 'kaid_326465577260382527912172' * }) * const json = await response.json() * const profile = json.data.user * ``` */ declare function getUserHoverCardProfile(variables: GetUserHoverCardProfile.Variables, init?: RequestInit): Promise>; /** * @example * Alternative usage: * ```js * const response = await queries.getUserHoverCardProfile('kaid_326465577260382527912172') * const json = await response.json() * const profile = json.data.user * ``` */ declare function getUserHoverCardProfile(kaid: Kaid, init?: RequestInit): Promise>; declare namespace Hotlist { const query = "query hotlist($curationNodeId: String, $onlyOfficialProjectSpinoffs: Boolean!, $sort: ListProgramSortOrder, $pageInfo: ListProgramsPageInfo, $userAuthoredContentTypes: [UserAuthoredContentType!]) {\n listTopPrograms(\n curationNodeId: $curationNodeId\n onlyOfficialProjectSpinoffs: $onlyOfficialProjectSpinoffs\n sort: $sort\n pageInfo: $pageInfo\n userAuthoredContentTypes: $userAuthoredContentTypes\n ) {\n complete\n cursor\n programs {\n id\n key\n authorKaid\n authorNickname\n displayableSpinoffCount\n imagePath\n sumVotesIncremented\n translatedTitle: title\n url\n userAuthoredContentType\n __typename\n }\n __typename\n }\n}"; interface Variables { curationNodeId?: string | null; onlyOfficialProjectSpinoffs: boolean; sort?: ListProgramSortOrder | null; pageInfo?: { cursor?: string | null; itemsPerPage: number; }; } type Response = StandardResponse; type Data = { listTopPrograms: ListProgramsSchema>; }; } /** * Low-level function for making a `hotlist` request. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#63956e0c-3e52-410a-9c80-70b5b8031d97} * * @example * Simple usage without error handling: * ```js * const response = await queries.hotlist({ * onlyOfficialProjectSpinoffs: false, * }) * const json = await response.json() * const programs = json.data.listTopPrograms.programs * ``` */ declare function hotlist(variables: Hotlist.Variables, init?: RequestInit): Promise>; declare namespace ProgramQuery { const query = "query programQuery($programId: String!) {\n programById(id: $programId) {\n byChild\n category\n created\n creatorProfile: author {\n id\n nickname\n profileRoot\n profile {\n accessLevel\n __typename\n }\n __typename\n }\n deleted\n description\n spinoffCount: displayableSpinoffCount\n docsUrlPath\n flags\n flaggedBy: flaggedByKaids\n flaggedByUser: isFlaggedByCurrentUser\n height\n hideFromHotlist\n id\n imagePath\n isProjectOrFork: originIsProject\n isOwner\n kaid: authorKaid\n key\n newUrlPath\n originScratchpad: originProgram {\n deleted\n translatedTitle\n url\n __typename\n }\n restrictPosting\n revision: latestRevision {\n id\n code\n configVersion\n created\n editorType\n folds\n __typename\n }\n slug\n sumVotesIncremented\n title\n topic: parentCurationNode {\n id\n nodeSlug: slug\n relativeUrl\n slug\n translatedTitle\n __typename\n }\n translatedTitle\n url\n userAuthoredContentType\n upVoted\n width\n __typename\n }\n}"; interface Variables { programId: string; } type Response = StandardResponse; type Data = { programById: Pick>, '__typename' | 'byChild' | 'category' | 'created' | 'creatorProfile' | 'deleted' | 'description' | 'docsUrlPath' | 'flaggedBy' | 'flaggedByUser' | 'flags' | 'height' | 'hideFromHotlist' | 'id' | 'imagePath' | 'isOwner' | 'isProjectOrFork' | 'kaid' | 'key' | 'newUrlPath' | 'originScratchpad' | 'restrictPosting' | 'revision' | 'slug' | 'spinoffCount' | 'sumVotesIncremented' | 'title' | 'topic' | 'translatedTitle' | 'upVoted' | 'url' | 'userAuthoredContentType' | 'width'> | null; }; } /** * Low-level function for making a `programQuery` request. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#77a4642b-3580-4409-b837-1ac82a487c35 | Reference} * * @see {@link Client.getProgram} * * @example * Simple usage without error handling: * ```js * const response = await queries.programQuery({ * programId: '6058668928843776' * }) * const json = await response.json() * const program = json.data.programById * ``` */ declare function programQuery(variables: ProgramQuery.Variables, init?: RequestInit): Promise>; /** * @example * Alternative usage: * ```js * const response = await queries.programQuery(6058668928843776) * const json = await response.json() * const program = json.data.programById * ``` */ declare function programQuery(programId: ProgramID, init?: RequestInit): Promise>; declare namespace ProjectsAuthoredByUser { const query = "query projectsAuthoredByUser($kaid: String, $pageInfo: ListProgramsPageInfo, $sort: ListProgramSortOrder) {\n user(kaid: $kaid) {\n id\n programs(pageInfo: $pageInfo, sort: $sort) {\n complete\n cursor\n programs {\n id\n key\n authorKaid\n authorNickname\n displayableSpinoffCount\n imagePath\n sumVotesIncremented\n translatedTitle: title\n url\n __typename\n }\n __typename\n }\n __typename\n }\n}"; interface Variables { kaid: Kaid; pageInfo?: { cursor?: string | null; itemsPerPage: number; }; sort?: ListProgramSortOrder; } type Response = StandardResponse; type Data = { user: Pick & { translatedTitle: ProgramSchema['title']; }>>, '__typename' | 'id' | 'kaid' | 'programs'>; }; } /** * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#fe90a093-1deb-48bc-98a0-116275b2f512 | Reference} */ declare function projectsAuthoredByUser(variables: ProjectsAuthoredByUser.Variables, init?: RequestInit): Promise>; declare namespace QaExpandKeyInfo { const query = "query QAExpandKeyInfo($encryptedKey: String) {\n qaExpandKeyInfo(encryptedQaExpandKey: $encryptedKey) {\n feedbackType\n unencryptedKey\n __typename\n }\n}"; interface Variables { encryptedKey: string; } type Response = StandardResponse; type Data = { qaExpandKeyInfo: QaExpandKeyInfoSchema; }; } /** * Low-level function for making a `QAExpandKeyInfo` request. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#2354cba6-9065-4431-8d4a-f44f24527eb4 | Reference} * * @example * Simple usage without error handling: * ```js * const response = await queries.QAExpandKeyInfo({ * encryptedKey: 'kaencrypted_e1af9ca95e8bf24e1cebdb8a1e94f7a3_76142801656102acc04c5154ee776b59e6323603d457c39e2a18a68f32a9ac1fefcdfd57c28ec771ec62fbee8ae03e0509090d80723bb489a87010ba69a0a5fdbd27a91a0db97971b59b77548da0eb2494aa274600fa28939e8975abd13c851c5a2f4f701d7dc7e8a2879f3c8d59be0953fafa318bd9b036f6c3d6dc0212c926' * }) * const json = await response.json() * const unencryptedKey = json.data.qaExpandKeyInfo?.unencryptedKey * ``` */ declare function QAExpandKeyInfo(variables: QaExpandKeyInfo.Variables, init?: RequestInit): Promise>; /** * @example * Alternative usage: * ```js * const response = await queries.QAExpandKeyInfo('kaencrypted_e1af9ca95e8bf24e1cebdb8a1e94f7a3_76142801656102acc04c5154ee776b59e6323603d457c39e2a18a68f32a9ac1fefcdfd57c28ec771ec62fbee8ae03e0509090d80723bb489a87010ba69a0a5fdbd27a91a0db97971b59b77548da0eb2494aa274600fa28939e8975abd13c851c5a2f4f701d7dc7e8a2879f3c8d59be0953fafa318bd9b036f6c3d6dc0212c926') * const json = await response.json() * const unencryptedKey = json.data.qaExpandKeyInfo?.unencryptedKey * ``` */ declare function QAExpandKeyInfo(encryptedKey: EncryptedFeedbackKey, init?: RequestInit): Promise>; //# sourceMappingURL=index.d.ts.map import index_d$1_AvatarDataForProfile = AvatarDataForProfile; import index_d$1_FeedbackQuery = FeedbackQuery; import index_d$1_GetFeedbackReplies = GetFeedbackReplies; import index_d$1_GetFeedbackRepliesPage = GetFeedbackRepliesPage; import index_d$1_GetFullUserProfile = GetFullUserProfile; import index_d$1_GetProfileWidgets = GetProfileWidgets; import index_d$1_GetUserByUsernameOrEmail = GetUserByUsernameOrEmail; import index_d$1_GetUserHoverCardProfile = GetUserHoverCardProfile; import index_d$1_Hotlist = Hotlist; import index_d$1_ProgramQuery = ProgramQuery; import index_d$1_ProjectsAuthoredByUser = ProjectsAuthoredByUser; declare const index_d$1_QAExpandKeyInfo: typeof QAExpandKeyInfo; import index_d$1_QaExpandKeyInfo = QaExpandKeyInfo; declare const index_d$1_avatarDataForProfile: typeof avatarDataForProfile; declare const index_d$1_feedbackQuery: typeof feedbackQuery; declare const index_d$1_getFeedbackReplies: typeof getFeedbackReplies; declare const index_d$1_getFeedbackRepliesPage: typeof getFeedbackRepliesPage; declare const index_d$1_getFullUserProfile: typeof getFullUserProfile; declare const index_d$1_getProfileWidgets: typeof getProfileWidgets; declare const index_d$1_getUserByUsernameOrEmail: typeof getUserByUsernameOrEmail; declare const index_d$1_getUserHoverCardProfile: typeof getUserHoverCardProfile; declare const index_d$1_hotlist: typeof hotlist; declare const index_d$1_programQuery: typeof programQuery; declare const index_d$1_projectsAuthoredByUser: typeof projectsAuthoredByUser; declare namespace index_d$1 { export { index_d$1_AvatarDataForProfile as AvatarDataForProfile, index_d$1_FeedbackQuery as FeedbackQuery, index_d$1_GetFeedbackReplies as GetFeedbackReplies, index_d$1_GetFeedbackRepliesPage as GetFeedbackRepliesPage, index_d$1_GetFullUserProfile as GetFullUserProfile, index_d$1_GetProfileWidgets as GetProfileWidgets, index_d$1_GetUserByUsernameOrEmail as GetUserByUsernameOrEmail, index_d$1_GetUserHoverCardProfile as GetUserHoverCardProfile, index_d$1_Hotlist as Hotlist, index_d$1_ProgramQuery as ProgramQuery, index_d$1_ProjectsAuthoredByUser as ProjectsAuthoredByUser, index_d$1_QAExpandKeyInfo as QAExpandKeyInfo, index_d$1_QaExpandKeyInfo as QaExpandKeyInfo, index_d$1_avatarDataForProfile as avatarDataForProfile, index_d$1_feedbackQuery as feedbackQuery, index_d$1_getFeedbackReplies as getFeedbackReplies, index_d$1_getFeedbackRepliesPage as getFeedbackRepliesPage, index_d$1_getFullUserProfile as getFullUserProfile, index_d$1_getProfileWidgets as getProfileWidgets, index_d$1_getUserByUsernameOrEmail as getUserByUsernameOrEmail, index_d$1_getUserHoverCardProfile as getUserHoverCardProfile, index_d$1_hotlist as hotlist, index_d$1_programQuery as programQuery, index_d$1_projectsAuthoredByUser as projectsAuthoredByUser, }; } declare namespace LoginWithPasswordMutation { const query = "mutation loginWithPasswordMutation($identifier: String!, $password: String!) {\n loginWithPassword(identifier: $identifier, password: $password) {\n user {\n id\n kaid\n canAccessDistrictsHomepage\n isTeacher\n hasUnresolvedInvitations\n preferredKaLocale {\n id\n kaLocale\n status\n __typename\n }\n __typename\n }\n isFirstLogin\n error {\n code\n __typename\n }\n __typename\n }\n}"; interface Variables { /** Email or username */ identifier: string; password: string; } type Response = StandardResponse<{ loginWithPassword: { __typename: 'LoginWithPasswordMutation'; error: { __typename: 'LoginWithPasswordMutationError'; code: ErrorCode; } | null; isFirstLogin: boolean | null; user: Pick | null; } | null; }>; enum ErrorCode { INVALID_CREDENTIALS = "INVALID_CREDENTIALS", TOO_MANY_ATTEMPTS = "TOO_MANY_ATTEMPTS" } } /** * Low-level function for making a `loginWithPasswordMutation` request. * * @remarks * There are many things that can go wrong with this request and Khan Academy * doesn't provide a great way to handle them. It's recommended to use * {@link Client.login | Client.login} instead. * * @link {@link https://khan-api.bhavjit.com/reference/view/19553924/2s8YzQUiXU#77a4642b-3580-4409-b837-1ac82a487c35 | Reference} * * @see {@link Client.login} * * @example * Simple usage without error handling: * ```js * const response = await mutations.loginWithPasswordMutation({ * identifier: 'username', // or email * password: 'password', * }) * * const cookies = response.headers.get('set-cookie') * ``` */ declare function loginWithPasswordMutation(variables: LoginWithPasswordMutation.Variables, init?: RequestInit): Promise>; //# sourceMappingURL=index.d.ts.map import index_d_LoginWithPasswordMutation = LoginWithPasswordMutation; declare const index_d_loginWithPasswordMutation: typeof loginWithPasswordMutation; declare namespace index_d { export { index_d_LoginWithPasswordMutation as LoginWithPasswordMutation, index_d_loginWithPasswordMutation as loginWithPasswordMutation, }; } /** * @link https://stackoverflow.com/a/51365037/9824991 */ type RecursivePartial = { [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends object ? RecursivePartial : T[P]; }; /** * The base class for all abstracted classes * * @remarks * This class is used to wrap the API schema into a more user-friendly * interface. */ declare abstract class Wrapper { /** * The client that this base was fetched with. */ client?: Client; /** * The raw base schema data * * @remarks * Only set if the base was created from a user schema. */ rawData?: RecursivePartial; /** * Transforms a API schema into an abstracted interface * * @param schema The schema to transform */ abstract transformSchema(schema: RecursivePartial): Interface; /** * Creates a new class instance */ constructor(data?: Interface); constructor(client: Client, data?: Interface); /** * Updates data into the class * * @param data The data to copy from * @returns The class instance */ copy(data: Interface): this; /** * Updates data from a schema into the instance * * @param schema The schema to copy from * @returns The class instance */ copyFromSchema(schema: RecursivePartial): this; /** * Gets and updates the instance's data * * @param client The API client to use */ abstract get(client?: Client): Promise; /** * Checks if the data represents the same instance */ abstract is(data: Interface): boolean; /** * Checks if the schema represents the same instance */ isSchema(schema: RecursivePartial): boolean; } interface IAnswer extends IMessage { question?: Question; } declare class Answer extends Message implements IAnswer { readonly question?: Question; static fromSchema(schema: RecursivePartial): Answer; static fromIdentifier(identifier: FeedbackKey | EncryptedFeedbackKey): Answer; transformSchema(schema: RecursivePartial): IAnswer; copy(answer: IAnswer): this; } interface IQuestion extends IMessage { answers?: Answer[]; answerCount?: number; old?: boolean; } /** * @remarks * Note that Help Requests are a type of Question. * * @raw {@link QuestionFeedbackSchema} */ declare class Question extends Message implements IQuestion { readonly answerCount?: number; readonly answers?: Answer[]; /** * @raw {@link QuestionFeedbackSchema.isOld} */ readonly old?: boolean; static fromSchema(schema: RecursivePartial): Question; static fromIdentifier(identifier: FeedbackKey | EncryptedFeedbackKey): Question; transformSchema(schema: RecursivePartial): IQuestion; copy(question: IQuestion): this; } type ITipsAndThanks = IMessage; declare class TipsAndThanks extends Message { static fromSchema(schema: RecursivePartial): TipsAndThanks; static fromIdentifier(identifier: FeedbackKey | EncryptedFeedbackKey): TipsAndThanks; transformSchema(schema: RecursivePartial): ITipsAndThanks; copy(tipsAndThanks: ITipsAndThanks): this; } declare enum BadgeCategory { Meteorite = 0, Moon = 1, Earth = 2, Sun = 3, BlackHole = 4, Challenge = 5 } interface BadgeIcons { /** * 40 x 40 PNG */ small: string; /** * 60 x 60 PNG */ compact: string; /** * 70 x 70 PNG */ email: string; /** * 512 x 512 PNG */ large: string; } interface UserStatistics { readonly votes: number; readonly tipsAndThanks: number; readonly questions: number; readonly answers: number; readonly helpRequests: number; readonly helpRequestAnswers: number; readonly replies: number; readonly flags: number; } interface IUser { readonly self?: boolean; readonly kaid?: Kaid | null; readonly username?: string | null; readonly nickname?: string; readonly email?: string; readonly emails?: string[]; readonly avatar?: AvatarURL; readonly bio?: string; readonly points?: number; readonly badgeCounts?: Record; readonly joined?: Date; readonly key?: string; readonly googleID?: string | null; readonly qualarooID?: string | null; readonly newNotifications?: number; readonly completedVideos?: number; readonly canAccessDistrictsHomepage?: boolean; readonly canHellban?: boolean; readonly canMessageUsers?: boolean; readonly canModifyCoaches?: boolean; readonly hasAccessToAIGuideDev?: boolean; readonly hasAccessToAIGuideTeacher?: boolean; readonly hasChildren?: boolean; readonly hasClasses?: boolean; readonly hasCoach?: boolean; readonly hasStudents?: boolean; readonly developer?: boolean; readonly moderator?: boolean; readonly child?: boolean; readonly parent?: boolean; readonly orphan?: boolean; readonly teacher?: boolean; readonly curator?: boolean; readonly publisher?: boolean; readonly creator?: boolean; readonly phantom?: boolean; readonly midsignupPhantom?: boolean; readonly accessLevel?: UserAccessLevel; readonly statistics?: UserStatistics; readonly programs?: Program[]; } declare class User extends Wrapper implements IUser { #private; /** * Whether the user is the currently authenticated user. */ readonly self?: boolean; /** * The user's KAID. */ readonly kaid?: Kaid | null; /** * The user's username. May not be set by the user. */ readonly username?: string | null; /** * The user's nickname. May in rare cases be `null`. */ readonly nickname?: string; /** * The user's email address. Required authentication. */ readonly email?: string; /** * The user's authentication email addresses. Required authentication. */ readonly emails?: string[]; /** * The user's avatar URL. */ readonly avatar?: AvatarURL; /** * The user's bio. */ readonly bio?: string; /** * The user's energy points. */ readonly points?: number; /** * The user's badge counts by category. */ readonly badgeCounts?: Record; /** * The date the user created their account. */ readonly joined?: Date; readonly key?: string; readonly googleID?: string | null; readonly qualarooID?: string | null; /** * The number of unread notifications. */ readonly newNotifications?: number; readonly completedVideos?: number; readonly canAccessDistrictsHomepage?: boolean; readonly canHellban?: boolean; /** * Whether the user can send Guardian messages. */ readonly canMessageUsers?: boolean; readonly canModifyCoaches?: boolean; readonly hasAccessToAIGuideDev?: boolean; readonly hasAccessToAIGuideTeacher?: boolean; readonly hasChildren?: boolean; readonly hasClasses?: boolean; readonly hasCoach?: boolean; readonly hasStudents?: boolean; readonly developer?: boolean; /** * Whether the user is a Guardian. */ readonly moderator?: boolean; /** * Whether the user is a child account. */ readonly child?: boolean; readonly parent?: boolean; readonly orphan?: boolean; readonly teacher?: boolean; readonly formalTeacher?: boolean; readonly curator?: boolean; readonly publisher?: boolean; readonly creator?: boolean; readonly phantom?: boolean; readonly midsignupPhantom?: boolean; readonly accessLevel?: UserAccessLevel; readonly statistics?: UserStatistics; readonly programs?: Program[]; get url(): `http${string}://${string}khanacademy.${string}/profile/${string}` | null; /** * Creates a new user from the given from a user schema * * @description * Note that `Client.getUser` will automatically call this method. This is only useful if you need to use the low-level API. * * @param schema * * @see {@link Client.getUser} */ static fromSchema(schema: RecursivePartial): User; static fromIdentifier(identifier: Kaid | string | Email): User; transformSchema(schema: RecursivePartial): { emails: string[] | undefined; badgeCounts: Record | undefined; bio: string | undefined; canAccessDistrictsHomepage: boolean | undefined; canHellban: boolean | undefined; canMessageUsers: boolean | undefined; canModifyCoaches: boolean | undefined; completedVideos: number | undefined; email: string | undefined; hasAccessToAIGuideDev: boolean | undefined; hasAccessToAIGuideTeacher: boolean | undefined; hasChildren: boolean | undefined; hasClasses: boolean | undefined; hasCoach: boolean | undefined; hasStudents: boolean | undefined; child: boolean | undefined; creator: boolean | undefined; curator: boolean | undefined; developer: boolean | undefined; midsignupPhantom: boolean | undefined; moderator: boolean | undefined; orphan: boolean | undefined; parent: boolean | undefined; phantom: boolean | undefined; publisher: boolean | undefined; self: boolean | undefined; teacher: boolean | undefined; formalTeacher: boolean | undefined; joined: Date | undefined; kaid: `kaid_${number}` | null | undefined; key: string | undefined; newNotifications: number | undefined; nickname: string | undefined; points: number | undefined; accessLevel: UserAccessLevel | undefined; googleID: string | null | undefined; qualarooID: string | null | undefined; username: string | null | undefined; }; /** * Fetches the user's profile using a `getFullUserProfile` query and updates the user's data * * @param client Optional client to use for the request * * @see {@link Client.getUser} */ get(client?: Client): Promise; /** * @see {@link Client!.getUserAvatar} */ getAvatar(client?: Client): Promise<"https://www.khanacademy.org/images/avatars/svg/blobby-green.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-green.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-green.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-green.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-green.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-green.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-green.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-green.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-green.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-grey.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-red.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-green.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-red.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-red.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink-green.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_1.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_2.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_3.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_1.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_2.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_3.svg" | "https://www.khanacademy.org/images/avatars/svg/orange-juice-squid.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi-teal.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-green.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/old-spice-man.svg" | "https://www.khanacademy.org/images/avatars/svg/old-spice-man-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-winston.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-winston-baby.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-ohnoes.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-happy.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-jumping.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-cool.svg" | "https://www.khanacademy.org/images/avatars/blobby-green.png" | "https://www.khanacademy.org/images/avatars/blobby-yellow.png" | "https://www.khanacademy.org/images/avatars/blobby-blue.png" | "https://www.khanacademy.org/images/avatars/blobby-purple.png" | "https://www.khanacademy.org/images/avatars/area-52-yellow.png" | "https://www.khanacademy.org/images/avatars/area-52-blue.png" | "https://www.khanacademy.org/images/avatars/area-52-green.png" | "https://www.khanacademy.org/images/avatars/area-52-purple.png" | "https://www.khanacademy.org/images/avatars/eggleston-blue.png" | "https://www.khanacademy.org/images/avatars/eggleston-yellow.png" | "https://www.khanacademy.org/images/avatars/eggleston-green.png" | "https://www.khanacademy.org/images/avatars/eggleston-orange.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-purple.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-yellow.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-blue.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-green.png" | "https://www.khanacademy.org/images/avatars/boggle-yellow.png" | "https://www.khanacademy.org/images/avatars/boggle-blue.png" | "https://www.khanacademy.org/images/avatars/boggle-green.png" | "https://www.khanacademy.org/images/avatars/boggle-purple.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-green.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-yellow.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-blue.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-purple.png" | "https://www.khanacademy.org/images/avatars/stelly-blue.png" | "https://www.khanacademy.org/images/avatars/stelly-yellow.png" | "https://www.khanacademy.org/images/avatars/stelly-green.png" | "https://www.khanacademy.org/images/avatars/stelly-orange.png" | "https://www.khanacademy.org/images/avatars/cacteye-purple.png" | "https://www.khanacademy.org/images/avatars/cacteye-yellow.png" | "https://www.khanacademy.org/images/avatars/cacteye-blue.png" | "https://www.khanacademy.org/images/avatars/cacteye-green.png" | "https://www.khanacademy.org/images/avatars/leaf-green.png" | "https://www.khanacademy.org/images/avatars/leaf-blue.png" | "https://www.khanacademy.org/images/avatars/leaf-grey.png" | "https://www.khanacademy.org/images/avatars/leaf-red.png" | "https://www.khanacademy.org/images/avatars/leaf-orange.png" | "https://www.khanacademy.org/images/avatars/leaf-yellow.png" | "https://www.khanacademy.org/images/avatars/leafers-seed.png" | "https://www.khanacademy.org/images/avatars/leafers-seedling.png" | "https://www.khanacademy.org/images/avatars/leafers-sapling.png" | "https://www.khanacademy.org/images/avatars/leafers-tree.png" | "https://www.khanacademy.org/images/avatars/leafers-ultimate.png" | "https://www.khanacademy.org/images/avatars/piceratops-seed.png" | "https://www.khanacademy.org/images/avatars/piceratops-seedling.png" | "https://www.khanacademy.org/images/avatars/piceratops-sapling.png" | "https://www.khanacademy.org/images/avatars/piceratops-tree.png" | "https://www.khanacademy.org/images/avatars/piceratops-ultimate.png" | "https://www.khanacademy.org/images/avatars/duskpin-seed.png" | "https://www.khanacademy.org/images/avatars/duskpin-seedling.png" | "https://www.khanacademy.org/images/avatars/duskpin-sapling.png" | "https://www.khanacademy.org/images/avatars/duskpin-tree.png" | "https://www.khanacademy.org/images/avatars/duskpin-ultimate.png" | "https://www.khanacademy.org/images/avatars/primosaur-seed.png" | "https://www.khanacademy.org/images/avatars/primosaur-seedling.png" | "https://www.khanacademy.org/images/avatars/primosaur-sapling.png" | "https://www.khanacademy.org/images/avatars/primosaur-tree.png" | "https://www.khanacademy.org/images/avatars/primosaur-ultimate.png" | "https://www.khanacademy.org/images/avatars/starky-seed.png" | "https://www.khanacademy.org/images/avatars/starky-seedling.png" | "https://www.khanacademy.org/images/avatars/starky-sapling.png" | "https://www.khanacademy.org/images/avatars/starky-tree.png" | "https://www.khanacademy.org/images/avatars/starky-ultimate.png" | "https://www.khanacademy.org/images/avatars/aqualine-seed.png" | "https://www.khanacademy.org/images/avatars/aqualine-seedling.png" | "https://www.khanacademy.org/images/avatars/aqualine-sapling.png" | "https://www.khanacademy.org/images/avatars/aqualine-tree.png" | "https://www.khanacademy.org/images/avatars/aqualine-ultimate.png" | "https://www.khanacademy.org/images/avatars/spunky-sam.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-green.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-orange.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-red.png" | "https://www.khanacademy.org/images/avatars/marcimus.png" | "https://www.khanacademy.org/images/avatars/marcimus-orange.png" | "https://www.khanacademy.org/images/avatars/marcimus-red.png" | "https://www.khanacademy.org/images/avatars/marcimus-purple.png" | "https://www.khanacademy.org/images/avatars/mr-pink.png" | "https://www.khanacademy.org/images/avatars/mr-pink-green.png" | "https://www.khanacademy.org/images/avatars/mr-pink-orange.png" | "https://www.khanacademy.org/images/avatars/robot_female_1.png" | "https://www.khanacademy.org/images/avatars/robot_female_2.png" | "https://www.khanacademy.org/images/avatars/robot_female_3.png" | "https://www.khanacademy.org/images/avatars/robot_male_1.png" | "https://www.khanacademy.org/images/avatars/robot_male_2.png" | "https://www.khanacademy.org/images/avatars/robot_male_3.png" | "https://www.khanacademy.org/images/avatars/orange-juice-squid.png" | "https://www.khanacademy.org/images/avatars/purple-pi.png" | "https://www.khanacademy.org/images/avatars/purple-pi-pink.png" | "https://www.khanacademy.org/images/avatars/purple-pi-teal.png" | "https://www.khanacademy.org/images/avatars/mr-pants.png" | "https://www.khanacademy.org/images/avatars/mr-pants-green.png" | "https://www.khanacademy.org/images/avatars/mr-pants-orange.png" | "https://www.khanacademy.org/images/avatars/mr-pants-pink.png" | "https://www.khanacademy.org/images/avatars/mr-pants-purple.png" | "https://www.khanacademy.org/images/avatars/old-spice-man.png" | "https://www.khanacademy.org/images/avatars/old-spice-man-blue.png" | "https://www.khanacademy.org/images/avatars/cs-winston.png" | "https://www.khanacademy.org/images/avatars/cs-winston-baby.png" | "https://www.khanacademy.org/images/avatars/cs-ohnoes.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-happy.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-jumping.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-cool.png">; /** * @see {@link Client.getUserStatistics} */ getStatistics(client?: Client): Promise; /** * @see {@link Client.getUserPrograms} */ getPrograms(client?: Client, sort?: ListProgramSortOrder, limit?: number): AsyncGenerator; /** * @see {@link Client.getAllUserPrograms} */ getAllPrograms(client?: Client, sort?: ListProgramSortOrder, limit?: number): Promise; /** * Checks if two users are the same * * @param user The user to compare to */ is(user: User | IUser): boolean; } /** * Resolve a KAID from a username or email address * * @param identifier A KAID, username, or email address * * @example * const kaid = await resolveKaid('bhavjitChauhan') * console.log(kaid) // kaid_376749826184384230772276 */ declare function resolveKaid(identifier: Kaid | string | Email | UserURL): Promise; /** * Resolve a username from a KAID or email address * * @param identifier KAID, username, or email address * * @example * const username = await resolveUsername('kaid_376749826184384230772276') * console.log(username) // bhavjitChauhan */ declare function resolveUsername(identifier: Kaid | string | Email | UserURL): Promise; /** * Resolve a program ID from a program URL or key * * @param identifier Program ID, URL, or key * * @returns Program ID as a number */ declare function resolveProgramID(identifier: ProgramID | ProgramURL | ProgramKey): ProgramIDNumber; /** * Resolves a feedback key from an encrypted feedback key * * @param identifier Feedback key or encrypted feedback key */ declare function resolveFeedbackKey(identifier: FeedbackKey | EncryptedFeedbackKey): Promise; /** * @raw {@link ProgramEditorType} */ declare enum ProgramType { ProcessingJS = "pjs", HTML = "webpage", SQL = "ace_sql", Other = "" } interface IProgram { readonly id?: ProgramIDNumber; readonly title?: string; readonly author?: User; readonly created?: Date; readonly updated?: Date | null; readonly width?: number; readonly height?: number; readonly votes?: number; readonly spinOffCount?: number; readonly hidden?: boolean; readonly code?: string; readonly type?: ProgramType; readonly origin?: Program | null; readonly key?: ProgramKey; readonly thumbnailID?: number; readonly description?: string | null; readonly deleted?: boolean; readonly category?: string; readonly selfFlagged?: boolean; readonly selfVoted?: boolean; readonly tipsAndThanks?: TipsAndThanks[]; readonly questions?: Question[]; readonly helpRequests?: Question[]; } declare class Program extends Wrapper, IProgram> implements IProgram { #private; /** * Aliases for the program types. * * @raw {@link ProgramRevisionSchema.editorType} */ static readonly Type: typeof ProgramType; /** * The ID of the program. */ readonly id?: number; /** * The title of the program. */ readonly title?: string; /** * The author of the program. */ readonly author?: User; /** * The date the program was created. */ readonly created?: Date; /** * The date the program was last updated. * * @description * Set to `null` if the program has never been updated. */ readonly updated?: Date | null; /** * The height of the program in pixels. * * @description * Constrained between 400 and 600. May be any value in between. */ readonly width?: number; /** * The height of the program in pixels. * * @description * Constrained between 400 and 600. May be any value in between. */ readonly height?: number; /** * The number of votes the program has received. * * @description * Note that a program has 1 vote on creation. */ readonly votes?: number; /** * The number of spin-offs the program has. */ readonly spinOffCount?: number; /** * The code of the program. */ readonly code?: string; /** * Whether the program is hidden from the hotlist. */ readonly hidden?: boolean; /** * The type of program. */ readonly type?: ProgramType; /** * The original program that this program is a spin-off of. */ readonly origin?: Program | null; readonly key?: ProgramKey; /** * The ID of the latest thumbnail image of the program. * * @description * Previous thumbnails are not guaranteed to be available. */ readonly thumbnailID?: number; /** * The description of the program. Set to `null` if the description is empty string. */ readonly description?: string | null; /** * Whether the program has been deleted. */ readonly deleted?: boolean; /** * Whether the program has been flagged by the client's authenticated user. * * @see {@link client} */ readonly selfFlagged?: boolean; /** * Whether the program has been voted by the client's authenticated user. * * @see {@link client} */ readonly selfVoted?: boolean; readonly tipsAndThanks?: TipsAndThanks[]; readonly questions?: Question[]; readonly helpRequests?: Question[]; get spinoff(): boolean | null; /** * Number of lines of code in the program. */ get lines(): number | null; /** * URL of the program. */ get url(): string | null; /** * Short URL of the program. */ get shortUrl(): string | null; /** * Thumbnail image URL of the program. * * @description * To get the latest thumbnail image, use 'latest' as the thumbnail ID instead. */ get thumbnailUrl(): string | null; static fromSchema(schema: RecursivePartial>): Program; static fromIdentifier(identifier: Parameters[0]): Program; transformSchema(schema: RecursivePartial>): { id: number | undefined; title: string | undefined; author: User | undefined; created: Date | undefined; updated: Date | null | undefined; width: number | undefined; height: number | undefined; votes: number | undefined; spinOffCount: number | undefined; code: string | undefined; hidden: boolean | undefined; type: ProgramType; origin: Program | null | undefined; key: `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}` | undefined; thumbnailID: number | undefined; description: string | null | undefined; deleted: boolean | undefined; selfFlagged: boolean | undefined; selfVoted: boolean | undefined; }; get(client?: Client): Promise; getTipsAndThanks(client?: Client, sort?: FeedbackSort): AsyncGenerator; getAllTipsAndThanks(client?: Client, sort?: FeedbackSort): Promise; getQuestions(client?: Client, sort?: FeedbackSort): AsyncGenerator; getAllQuestions(client?: Client, sort?: FeedbackSort): Promise; getHelpRequests(client?: Client, sort?: FeedbackSort): AsyncGenerator; getAllHelpRequests(client?: Client, sort?: FeedbackSort): Promise; is(program: IProgram): boolean; } interface IBaseMessage { author?: User; byVideoAuthor?: boolean; created?: Date; deleted?: boolean; encryptedKey?: string; locked?: boolean; key?: string; pinned?: boolean; program?: Program; score?: number; selfFlagged?: boolean; text?: string; verified?: boolean; } declare abstract class BaseMessage extends Wrapper implements IBaseMessage { /** * @raw {@link FeedbackSchemaBase.content} */ readonly text?: string; readonly author?: User; readonly program?: Program; /** * @raw {@link FeedbackSchemaBase.date} */ readonly created?: Date; /** * @raw {@link FeedbackSchemaBase.expandKey} */ readonly key?: FeedbackKey; /** * @raw {@link FeedbackSchemaBase.key} */ readonly encryptedKey?: EncryptedFeedbackKey; /** * @raw {@link FeedbackSchemaBase.appearsAsDeleted} */ readonly deleted?: boolean; /** * @raw {@link FeedbackSchemaBase.isLocked} */ readonly locked?: boolean; /** * @raw {@link FeedbackSchemaBase.isPinned} */ readonly pinned?: boolean; /** * @raw {@link FeedbackSchemaBase.definitelyNotSpam} */ readonly verified?: boolean; /** * @raw {@link FeedbackSchemaBase.lowQualityScore} */ readonly score?: number; /** * @raw {@link FeedbackSchemaBase.fromVideoAuthor} */ readonly byVideoAuthor?: boolean; /** * @raw {@link FeedbackSchemaBase.flaggedByUser} */ readonly selfFlagged?: boolean; /** * Checks if the message was written by the client user */ get bySelf(): boolean; get url(): string | null; transformSchema(schema: RecursivePartial): IBaseMessage; /** * Checks if the message was written by the given user */ byUser(user: User): boolean; /** * Checks if the message is the same as the given message */ is(message: BaseMessage | IBaseMessage): boolean; } interface IReply extends IBaseMessage { message?: Message; } declare class Reply extends BaseMessage implements IReply { readonly message?: Message; static fromSchema(schema: RecursivePartial): Reply; static fromIdentifier(identifier: FeedbackKey | EncryptedFeedbackKey): Reply; transformSchema(schema: RecursivePartial): IReply; copy(reply: IReply): this; /** * Updates data from a schema into the instance * * @param schema The schema to copy from * @returns The class instance */ copyFromSchema(schema: RecursivePartial): this; get(client?: Client): Promise; } /** * @raw {@link FeedbackType} */ declare enum MessageType { TipsAndThanks = "COMMENT", Question = "QUESTION", HelpRequest = "PROJECT_HELP_QUESTION" } interface IMessage extends IBaseMessage { replies?: Reply[]; replyCount?: number; selfDownvoted?: boolean; selfUpvoted?: boolean; votes?: number; } declare class Message extends BaseMessage implements IMessage { #private; /** * Aliases for the message types. */ static readonly Type: typeof MessageType; /** * @raw {@link FeedbackSchemaBase.sumVotesIncremented} */ readonly votes?: number; /** * @raw {@link FeedbackSchemaBase.upVoted} */ readonly selfUpvoted?: boolean; /** * @raw {@link FeedbackSchemaBase.downVoted} */ readonly selfDownvoted?: boolean; readonly replyCount?: number; readonly replies?: Reply[]; /** * @returns `1` if the message was upvoted by the user, `-1` if it was downvoted, * and `0` if it was not voted on. `null` if the user is not logged in. * * @see {@link Message.selfUpvoted} * @see {@link Message.selfDownvoted} */ get selfVoted(): 1 | 0 | -1 | null; static fromSchema(schema: RecursivePartial): Message; static fromIdentifier(identifier: FeedbackKey | EncryptedFeedbackKey): Message; transformSchema(schema: RecursivePartial): IMessage; copy(message: IMessage): this; get(client?: Client): Promise; /** * @see {@link Client.getMessageReplies} */ getReplies(client?: Client, limit?: number): AsyncGenerator; /** * @see {@link Client.getAllMessageReplies} */ getAllReplies(client?: Client): Promise; } declare class Client { #private; authenticated: boolean; kaid: Kaid | null; user?: User; /** * Creates a new Client instance * * @example * const client = new Client() */ constructor(); /** * Resolves a username or email to a KAID and caches the result * * @remarks * If the identifier is cached, it will be returned immediately. Otherwise a * `getUserByUsernameOrEmail` request will be made to resolve the identifier * * @see {@link resolveKaid} * * @example * const getKaid = async () => await client.resolveCachedKaid('bhavjitChauhan') * console.log(await getKaid()) // Makes a request * console.log(await getKaid()) // Returns cached result */ resolveCachedKaid(identifier: Parameters[0]): Promise; /** * Resolves a KAID to a username and caches the result * * @remarks * If the identifier is cached, it will be returned immediately. Otherwise a * `getUserHoverCardProfile` request will be made to resolve the identifier * * @see {@link resolveUsername} * * @example * const getUsername = async () => await client.resolveCachedUsername('kaid_376749826184384230772276') * console.log(await getUsername()) // Makes a request * console.log(await getUsername()) // Returns cached result */ resolveCachedUsername(identifier: Parameters[0]): Promise; /** * Resolved an encrypted message key to an unencrypted message key and caches * the result * * @remarks * If the identifier is cached, it will be returned immediately. Otherwise a * `QAExpandKeyInfo` request will be made to resolve the identifier * * @see {@link resolveFeedbackKey} */ resolveCachedFeedbackKey(identifier: Parameters[0]): Promise<`ag5zfmtoYW4tYWNhZGVteX${string}CxIIVXNlckRhdGEi${string}thaWRf${string}${string}${string}`>; /** * Gets the KAAS cookie from the current session * * @remarks * The KAAS cookie is used by Khan Academy to authenticate requests. * * @returns KAAS cookie or null if not authenticated */ get kaas(): string | null; /** * Logs in to Khan Academy and stores the KAAS cookie * * @param identifier KAID, username or email * @param password */ login(identifier?: Kaid | string | Email, password?: string): Promise; /** * @param identifier KAID, username or email */ getUser(identifier?: Parameters[0]): Promise; getUserAvatar(identifier?: Parameters[0] | undefined, type?: 'svg' | 'png'): Promise<"https://www.khanacademy.org/images/avatars/svg/blobby-green.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-green.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-green.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-green.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-green.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-green.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-green.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-green.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-green.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-grey.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-red.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-green.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-red.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-red.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink-green.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_1.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_2.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_3.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_1.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_2.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_3.svg" | "https://www.khanacademy.org/images/avatars/svg/orange-juice-squid.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi-teal.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-green.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/old-spice-man.svg" | "https://www.khanacademy.org/images/avatars/svg/old-spice-man-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-winston.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-winston-baby.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-ohnoes.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-happy.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-jumping.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-cool.svg" | "https://www.khanacademy.org/images/avatars/blobby-green.png" | "https://www.khanacademy.org/images/avatars/blobby-yellow.png" | "https://www.khanacademy.org/images/avatars/blobby-blue.png" | "https://www.khanacademy.org/images/avatars/blobby-purple.png" | "https://www.khanacademy.org/images/avatars/area-52-yellow.png" | "https://www.khanacademy.org/images/avatars/area-52-blue.png" | "https://www.khanacademy.org/images/avatars/area-52-green.png" | "https://www.khanacademy.org/images/avatars/area-52-purple.png" | "https://www.khanacademy.org/images/avatars/eggleston-blue.png" | "https://www.khanacademy.org/images/avatars/eggleston-yellow.png" | "https://www.khanacademy.org/images/avatars/eggleston-green.png" | "https://www.khanacademy.org/images/avatars/eggleston-orange.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-purple.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-yellow.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-blue.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-green.png" | "https://www.khanacademy.org/images/avatars/boggle-yellow.png" | "https://www.khanacademy.org/images/avatars/boggle-blue.png" | "https://www.khanacademy.org/images/avatars/boggle-green.png" | "https://www.khanacademy.org/images/avatars/boggle-purple.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-green.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-yellow.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-blue.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-purple.png" | "https://www.khanacademy.org/images/avatars/stelly-blue.png" | "https://www.khanacademy.org/images/avatars/stelly-yellow.png" | "https://www.khanacademy.org/images/avatars/stelly-green.png" | "https://www.khanacademy.org/images/avatars/stelly-orange.png" | "https://www.khanacademy.org/images/avatars/cacteye-purple.png" | "https://www.khanacademy.org/images/avatars/cacteye-yellow.png" | "https://www.khanacademy.org/images/avatars/cacteye-blue.png" | "https://www.khanacademy.org/images/avatars/cacteye-green.png" | "https://www.khanacademy.org/images/avatars/leaf-green.png" | "https://www.khanacademy.org/images/avatars/leaf-blue.png" | "https://www.khanacademy.org/images/avatars/leaf-grey.png" | "https://www.khanacademy.org/images/avatars/leaf-red.png" | "https://www.khanacademy.org/images/avatars/leaf-orange.png" | "https://www.khanacademy.org/images/avatars/leaf-yellow.png" | "https://www.khanacademy.org/images/avatars/leafers-seed.png" | "https://www.khanacademy.org/images/avatars/leafers-seedling.png" | "https://www.khanacademy.org/images/avatars/leafers-sapling.png" | "https://www.khanacademy.org/images/avatars/leafers-tree.png" | "https://www.khanacademy.org/images/avatars/leafers-ultimate.png" | "https://www.khanacademy.org/images/avatars/piceratops-seed.png" | "https://www.khanacademy.org/images/avatars/piceratops-seedling.png" | "https://www.khanacademy.org/images/avatars/piceratops-sapling.png" | "https://www.khanacademy.org/images/avatars/piceratops-tree.png" | "https://www.khanacademy.org/images/avatars/piceratops-ultimate.png" | "https://www.khanacademy.org/images/avatars/duskpin-seed.png" | "https://www.khanacademy.org/images/avatars/duskpin-seedling.png" | "https://www.khanacademy.org/images/avatars/duskpin-sapling.png" | "https://www.khanacademy.org/images/avatars/duskpin-tree.png" | "https://www.khanacademy.org/images/avatars/duskpin-ultimate.png" | "https://www.khanacademy.org/images/avatars/primosaur-seed.png" | "https://www.khanacademy.org/images/avatars/primosaur-seedling.png" | "https://www.khanacademy.org/images/avatars/primosaur-sapling.png" | "https://www.khanacademy.org/images/avatars/primosaur-tree.png" | "https://www.khanacademy.org/images/avatars/primosaur-ultimate.png" | "https://www.khanacademy.org/images/avatars/starky-seed.png" | "https://www.khanacademy.org/images/avatars/starky-seedling.png" | "https://www.khanacademy.org/images/avatars/starky-sapling.png" | "https://www.khanacademy.org/images/avatars/starky-tree.png" | "https://www.khanacademy.org/images/avatars/starky-ultimate.png" | "https://www.khanacademy.org/images/avatars/aqualine-seed.png" | "https://www.khanacademy.org/images/avatars/aqualine-seedling.png" | "https://www.khanacademy.org/images/avatars/aqualine-sapling.png" | "https://www.khanacademy.org/images/avatars/aqualine-tree.png" | "https://www.khanacademy.org/images/avatars/aqualine-ultimate.png" | "https://www.khanacademy.org/images/avatars/spunky-sam.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-green.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-orange.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-red.png" | "https://www.khanacademy.org/images/avatars/marcimus.png" | "https://www.khanacademy.org/images/avatars/marcimus-orange.png" | "https://www.khanacademy.org/images/avatars/marcimus-red.png" | "https://www.khanacademy.org/images/avatars/marcimus-purple.png" | "https://www.khanacademy.org/images/avatars/mr-pink.png" | "https://www.khanacademy.org/images/avatars/mr-pink-green.png" | "https://www.khanacademy.org/images/avatars/mr-pink-orange.png" | "https://www.khanacademy.org/images/avatars/robot_female_1.png" | "https://www.khanacademy.org/images/avatars/robot_female_2.png" | "https://www.khanacademy.org/images/avatars/robot_female_3.png" | "https://www.khanacademy.org/images/avatars/robot_male_1.png" | "https://www.khanacademy.org/images/avatars/robot_male_2.png" | "https://www.khanacademy.org/images/avatars/robot_male_3.png" | "https://www.khanacademy.org/images/avatars/orange-juice-squid.png" | "https://www.khanacademy.org/images/avatars/purple-pi.png" | "https://www.khanacademy.org/images/avatars/purple-pi-pink.png" | "https://www.khanacademy.org/images/avatars/purple-pi-teal.png" | "https://www.khanacademy.org/images/avatars/mr-pants.png" | "https://www.khanacademy.org/images/avatars/mr-pants-green.png" | "https://www.khanacademy.org/images/avatars/mr-pants-orange.png" | "https://www.khanacademy.org/images/avatars/mr-pants-pink.png" | "https://www.khanacademy.org/images/avatars/mr-pants-purple.png" | "https://www.khanacademy.org/images/avatars/old-spice-man.png" | "https://www.khanacademy.org/images/avatars/old-spice-man-blue.png" | "https://www.khanacademy.org/images/avatars/cs-winston.png" | "https://www.khanacademy.org/images/avatars/cs-winston-baby.png" | "https://www.khanacademy.org/images/avatars/cs-ohnoes.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-happy.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-jumping.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-cool.png">; getUserStatistics(identifier?: Parameters[0] | undefined): Promise; /** * Gets a user's programs * * @raw {@link queries!projectsAuthoredByUser} * * @example * const client = new Client() * for await (const programs of client.getUserPrograms('bhavjitChauhan')) { * console.log(programs.map(program => program.title)) * } */ getUserPrograms(identifier?: Parameters[0], sort?: ListProgramSortOrder, limit?: number): AsyncGenerator; /** * Gets all of a user's programs * * @see {@link Client.getUserPrograms} * * @example * const client = new Client() * const programs = await client.getAllUserPrograms('bhavjitChauhan') * console.log(programs.map(program => program.title)) */ getAllUserPrograms(identifier?: Kaid | string | Email, sort?: ListProgramSortOrder, limit?: number): Promise; /** * @param identifier Program ID, URL or key */ getProgram(identifier: Parameters[0]): Promise; /** * Gets programs from the hotlist * * @raw {@link queries!hotlist} * * @example * const client = new Client() * for await (const programs of client.getHotlistPrograms()) { * console.log(programs.map(program => program.title)) * } * * @param official Whether to only get official project spinoffs */ getHotlistPrograms(sort?: ListProgramSortOrder, limit?: number, official?: boolean): AsyncGenerator; getTopPrograms(limit?: number, official?: boolean): AsyncGenerator; getRecentPrograms(limit?: number, official?: boolean): AsyncGenerator; /** * Gets a single message by its feedback key or encrypted feedback key * * @remarks * This method is not recommended when you know the message's type. Use * {@link Client.getTipsAndThanks | `getTipsAndThanks`}, * {@link Client.getQuestion | `getQuestion`} or * {@link Client.getReply | `getReply`} instead. * * @param identifier Feedback key or encrypted feedback key */ getMessage(identifier: FeedbackKey | EncryptedFeedbackKey): Promise; /** * Gets a single tips and thanks message * * @param identifier Feedback key or encrypted feedback key */ getTipsAndThanks(identifier: FeedbackKey | EncryptedFeedbackKey): Promise; /** * Gets a single question message * * @remarks * Note that Help Requests are a type of question. * * @param identifier Feedback key or encrypted feedback key */ getQuestion(identifier: FeedbackKey | EncryptedFeedbackKey): Promise; /** * Gets a single answer message * * @param identifier Feedback key or encrypted feedback key */ getAnswer(identifier: FeedbackKey | EncryptedFeedbackKey): Promise; /** * Gets a single reply * * @param identifier Feedback key or encrypted feedback key */ getReply(identifier: FeedbackKey | EncryptedFeedbackKey): Promise; /** * Gets specified types of messages for a program * * @param identifier Program ID, program URL, or program key * * @example * const client = new Client() * for await (const messages of client.getProgramTipsAndThanks(5154160781082624)) { * console.log(messages.map(message => message.text) * } */ getProgramMessages(type: MessageType | undefined, identifier: Parameters[0], sort?: FeedbackSort): AsyncGenerator<(TipsAndThanks | Question)[], void, unknown>; /** * Gets all specified types of messages for a program * * @see {@link Client.getProgramMessages} * * @example * const client = new Client() * const messages = await client.getAllProgramMessages(undefined, 5154160781082624) * console.log(messages.map(message => message.text) */ getAllProgramMessages(type: MessageType | undefined, identifier: ProgramID | ProgramURL | ProgramKey, sort?: FeedbackSort): Promise; /** * Gets Tips and Thanks messages for a program * * @see {@link Client.getProgramMessages} */ getProgramTipsAndThanks(identifier: ProgramID | ProgramURL | ProgramKey, sort?: FeedbackSort): AsyncGenerator; /** * Gets all Tips and Thanks messages for a program * * @see {@link Client.getAllProgramMessages} */ getAllProgramTipsAndThanks(identifier: ProgramID | ProgramURL | ProgramKey, sort?: FeedbackSort): Promise; /** * Gets questions for a program * * @see {@link Client.getProgramMessages} */ getProgramQuestions(identifier: ProgramID | ProgramURL | ProgramKey, sort?: FeedbackSort): AsyncGenerator; /** * Gets all questions for a program * * @see {@link Client.getAllProgramMessages} */ getAllProgramQuestions(identifier: ProgramID | ProgramURL | ProgramKey, sort?: FeedbackSort): Promise; /** * Gets Help Requests for a program * * @see {@link Client.getProgramMessages} */ getProgramHelpRequests(identifier: ProgramID | ProgramURL | ProgramKey, sort?: FeedbackSort): AsyncGenerator; /** * Gets all Help Requests for a program * * @see {@link Client.getAllProgramMessages} */ getAllProgramHelpRequests(identifier: ProgramID | ProgramURL | ProgramKey, sort?: FeedbackSort): Promise; /** * Gets replies to a message * * @param identifier Feedback key or encrypted feedback key * * @raw {@link queries!getFeedbackRepliesPage} * * @example * const client = new Client() * for await (const replies of client.getMessageReplies('ag5zfmtoYW4tYWNhZGVteXJBCxIIVXNlckRhdGEiHmthaWRfNjYzMzc5NDA2ODA0Nzc0MjA1NjU0NTUzNAwLEghGZWVkYmFjaxiAgJO6wamwCgw')) { * console.log(replies.map(reply => reply.text)) * } */ getMessageReplies(identifier: FeedbackKey | EncryptedFeedbackKey, limit?: number): AsyncGenerator; /** * Gets all replies to a message * * @raw {@link queries!getFeedbackReplies} * * @see {@link Client.getMessageReplies} * * @example * const client = new Client() * const replies = await client.getAllMessageReplies('ag5zfmtoYW4tYWNhZGVteXJBCxIIVXNlckRhdGEiHmthaWRfNjYzMzc5NDA2ODA0Nzc0MjA1NjU0NTUzNAwLEghGZWVkYmFjaxiAgJO6wamwCgw')) * console.log(replies.map(reply => reply.text)) */ getAllMessageReplies(identifier: FeedbackKey | EncryptedFeedbackKey): Promise; } declare function isTipsAndThanksSchema(schema: BasicFeedbackSchema | QuestionFeedbackSchema | AnswerFeedbackSchema): schema is BasicFeedbackSchema; declare function isReplySchema(schema: BasicFeedbackSchema | QuestionFeedbackSchema | AnswerFeedbackSchema): schema is BasicFeedbackSchema; declare function isQuestionSchema(schema: BasicFeedbackSchema | QuestionFeedbackSchema | AnswerFeedbackSchema): schema is QuestionFeedbackSchema; declare function isAnswerSchema(schema: BasicFeedbackSchema | QuestionFeedbackSchema | AnswerFeedbackSchema): schema is AnswerFeedbackSchema; declare const TypeToMessageClass: { readonly COMMENT: typeof TipsAndThanks; readonly QUESTION: typeof Question; readonly PROJECT_HELP_QUESTION: typeof Question; }; /** * Decodes program ID from a program key * * @remarks * Program keys are (URL-safe) Base64 encoded strings that contain the program * ID. * * Credit to {@link https://github.com/L1quidH2O | @L1quidH2O} for the * original implementation. */ declare function programKeyToID(key: ProgramKey): ProgramIDNumber; /** * Encodes program ID to a program key * * @remarks * Credit to {@link https://github.com/L1quidH2O | @L1quidH2O} for the * original implementation. */ declare function programIDtoKey(id: ProgramID): ProgramKey; /** * Gets the latest version of a query from the Safelist. * * @param query The operation name of the query * * @see {@link https://github.com/bhavjitChauhan/khan-api/tree/safelist/query | Safelisted Queries} * * @example * const GET_FULL_USER_PROFILE_QUERY = await getLatestQuery('getFullUserProfile') */ declare function getLatestQuery(query: string): Promise; /** * Gets the latest version of a mutation from the Safelist. * * @param mutation The operation name of the mutation * * @see {@link https://github.com/bhavjitChauhan/khan-api/tree/safelist/mutation | Safelisted Mutations} */ declare function getLatestMutation(mutation: string): Promise; /** * Gets the latest version of a fragment from the Safelist. * * @param fragment The name of the fragment * * @see {@link https://github.com/bhavjitChauhan/khan-api/tree/safelist/fragment | Safelisted Fragments} */ declare function getLatestFragment(fragment: string): Promise; /** * Generates the djb2 hash for a query. * * @description * This hash may be used to make Khan API requests GET requests instead of POST * request queries. * * @example * const hash = hashQuery(GET_FULL_USER_PROFILE_QUERY) * const variables = { username: 'sal' } * const url = `https://www.khanacademy.org/api/internal/graphql/getFullUserProfile?hash=${hash}&variables=${encodeURIComponent(JSON.stringify(variables))}` * * const response = await fetch(url) * const data = await response.json() */ declare function hashQuery(document: string): number; /** * Gets the latest version of a query from the Safelist and returns its hash. * * @example * const hash = await getLatestQueryHash('getFullUserProfile') * const variables = { username: 'sal' } * const url = `https://www.khanacademy.org/api/internal/graphql/getFullUserProfile?hash=${hash}&variables=${encodeURIComponent(JSON.stringify(variables))}` * * const response = await fetch(url) * const data = await response.json() * * @see {@link hashQuery} */ declare function getLatestQueryHash(query: string): Promise; export { Answer, BadgeCategory, BaseMessage, Client, EmailRegex, EmailRegexMatch, FeedbackFocusKind, FeedbackKeyRegex, FeedbackKeyRegexMatch, FeedbackSort, FeedbackType, FeedbackTypename, GoogleIDRegex, GoogleIDRegexMatch, KaidRegex, KaidRegexMatch, ListProgramSortOrder, MESSAGE_ENCRYPTED_KEY_LENGTHS, MESSAGE_KEY_LENGTHS, Message, MessageEncryptedKeyRegex, MessageEncryptedKeyRegexMatch, MessageType, PROGRAM_ID_LENGTHS, PROGRAM_KEY_LENGTHS, PROGRAM_URL_PATHS, Program, ProgramEditorType, ProgramIDRegex, ProgramIDRegexMatch, ProgramImagePathRegex, ProgramImagePathRegexMatch, ProgramKeyRegex, ProgramKeyRegexMatch, ProgramType, ProgramURLRegex, ProgramURLRegexMatch, QualarooIDRegex, QualarooIDRegexMatch, Question, Reply, ServiceErrorCode, ServiceErrorName, TipsAndThanks, TypeToMessageClass, URL_LOCALES, URL_TLDS, User, UserAccessLevel, UserURLRegex, UserURLRegexMatch, assertDataResponse, avatarNameToSlug, avatarNames, avatarSlugToName, avatarSlugs, convertAvatarPNGToSVG, convertAvatarSVGToPNG, extractAvatarSlug, generateAvatarPNG, generateAvatarSVG, get, getLatestFragment, getLatestMutation, getLatestQuery, getLatestQueryHash, graphql, hashQuery, http, isAnswerSchema, isDataResponse, isEmail, isEncryptedFeedbackKey, isFeedbackKey, isGoogleID, isInputErrorResponse, isKaid, isProgramID, isProgramKey, isProgramURL, isQualarooID, isQuestionSchema, isReplySchema, isServiceErrorsResponse, isTipsAndThanksSchema, isUserURL, index_d as mutations, post, programIDtoKey, programKeyToID, index_d$1 as queries, resolveFeedbackKey, resolveKaid, resolveProgramID, resolveUsername }; export type { AnswerFeedbackSchema, AvatarName, AvatarPNG, AvatarPath, AvatarSVG, AvatarSchema, AvatarSlug, AvatarURL, BadgeIcons, BasicFeedbackSchema, DataResponse, Email, EncryptedFeedbackKey, FeedbackFocusSchema, FeedbackForFocusSchema, FeedbackKey, FeedbackSchemaBase, GoogleID, IAnswer, IBaseMessage, IMessage, IProgram, IQuestion, IReply, ITipsAndThanks, IUser, InputErrorResponse, Kaid, ListProgramsSchema, Locale, LocaleSchema, OriginProgramSchema, PendingEmailVerificationSchema, ProfileSchema, ProgramID, ProgramIDNumber, ProgramIDString, ProgramKey, ProgramRevisionSchema, ProgramSchema, ProgramURL, ProgramURLPath, QaExpandKeyInfoSchema, QualarooID, QuestionFeedbackSchema, RepliesSchema, ServiceErrorsResponse, StandardResponse, TopicSchema, TypedResponse, UserSchema, UserStatistics, UserStatisticsSchema, UserSummarySchema, UserURL };