/**
* Course
*/
export type Course = {
/**
* Course id
*/
id: number,
/**
* Course title
*/
title: Record<any, any>,
/**
* Course content
*/
content: Record<any, any>,
/**
* Date when course was created
*/
date: string,
/**
* Date when course was created
*/
date_gmt: string,
/**
* Date when course was modified
*/
modified: string,
/**
* Date when course was modified
*/
modified_gmt: string,
/**
* Link to the course
*/
link: string,
/**
* Slug of url to course
*/
slug: string,
/**
* User id of author
*/
author: number,
/**
* Course excerpt
*/
excerpt: Record<any, any>,
menu_order: number,
/**
* Url to featured image
*/
featured_media: Record<any, any>,
/**
* Url to cover image
*/
cover_media: Record<any, any>,
/**
* Returns `true` if user has access
*/
has_course_access: boolean,
/**
* Returns `true` if offline disabled
*/
offline_disabled: boolean,
/**
* Returns `true` if logged-in user has access to course's content
*/
has_content_access: boolean,
/**
* Course materials
*/
materials: undefined | string,
/**
* Returns `true` if course can be purchased
*/
purchasable: boolean,
/**
* Course price and currency
*/
price: Record<any, any>,
/**
* Returns `true` if content table is hidden
*/
hide_content_table: boolean,
/**
* User's progress in the course
*/
progression: number,
/**
* Returns `true` if course is closed
*/
is_closed: boolean,
/**
* Returns `true` if user can enroll to course
*/
can_enroll: boolean,
points: number,
duration: Record<any, any>,
/**
* Course categories
*/
categories: Record<any, any>[],
/**
* Course tags
*/
tags: Record<any, any>[],
/**
* Shows number of enrolled members
*/
enrolled_members: number,
/**
* Certificate details
*/
certificate: Record<any, any>,
module: Record<any, any>[],
/**
* Url to video of course
*/
video: string,
group: number,
forum: number,
/**
* Lessons associated to the course
*/
lessons: Record<any, any>[],
/**
* Quizzes associated to the course
*/
quizzes: Record<any, any>[],
/**
* Returns `true` if lesson has been completed
*/
completed: boolean,
/**
* Returns `true` if quiz has been completed
*/
quiz_completed: boolean,
/**
* Returns`true` if start function should be showed
*/
show_start: boolean,
error_message: Record<any, any>[],
last_activity_time: string,
excerpt_native: Record<any, any>,
/**
* Blocks in the course
*/
content_native: Record<any, any>[],
/**
* Access controls
*/
bb_access: Record<any, any>,
/**
* IAP products associated to the course
*/
bbapp_products: Record<any, any>,
_link: Record<any, any>,
_embedded: Record<any, any>,
/**
* Shows members enrolled in course
*/
members: Record<any, any>[]
};
/**
* TCourseViewModel
*/
export type TCourseViewModel = {
/**
* Course id
*/
id: number,
/**
* Url to featured image
*/
featuredUrl: string,
/**
* Url to cover image
*/
coverUrl: string,
/**
* Returns `true` if user can enroll to course
*/
canEnroll: boolean,
/**
* Returns a message if incomplete prerequisite
*/
incompletePrerequisiteMessage: string,
/**
* Course title
*/
title: string,
/**
* Returns course progression by the user
*/
progression: number,
/**
* Date of when course was created
*/
date: string,
/**
* Number of lessons in the course
*/
lessonsCount: number,
/**
* Number of lessons completed in the course
*/
lessonsCompleted: number,
/**
* Default function when a course widget is clicked
*/
onClick: Function,
/**
* Returns `true` if course is closed
*/
isClosed: boolean,
/**
* Returns `true` if user has access
*/
hasAccess: boolean,
/**
* Returns `true` if has content access
*/
hasContentAccess: boolean,
/**
* Returns `true` if content table is hidden
*/
hideContentTable: boolean,
/**
* Returns `true` if course can only be accessed if user has paid for it
*/
paidCourse: boolean,
/**
* Returns `true` if course has been completed by the logged-in user
*/
completed: boolean,
/**
* Link to the course
*/
link: string,
/**
* Returns `true` if course can be purchased
*/
purchasable: boolean,
/**
* Returns `true` if offline disabled
*/
offlineDisabled: boolean,
/**
* Url to video of course
*/
videoUrl: string | undefined,
/**
* Returns detail of access granted
*/
bb_access: Record<any, any>,
/**
* Course price and currency
*/
price: Record<any, any>,
/**
* Error message encountered
*/
error: Record<any, any>,
/**
* Id of course's author
*/
authorId: number,
/**
* Author details
*/
author: Record<any, any>,
/**
* Date of when course was last modified
*/
modifiedDate: string,
/**
* Returns`true` if start function should be showed
*/
showStart: boolean,
/**
* Certificate details
*/
certificate: Record<any, any>,
/**
* Shows members enrolled in course
*/
members: Record<any, any>[],
/**
* Shows number of enrolled members
*/
enrolledMmebers: number,
/**
* IAP products associated to the course
*/
iapProducts: Record<any, any>[],
/**
* Forum associated to the course
*/
forumId: number,
/**
* Course materials
*/
materials: undefined | string, // check value if defined
/**
* Course content
*/
content: string,
/**
* Blocks in the course
*/
contentNative: Record<any, any>[],
/**
* Lessons associated to the course
*/
lessons: Record<any, any>[],
/**
* Returns `true` if course is loading
*/
loading: boolean,
/**
* Quizzes associated to the course
*/
quizzes: Record<any, any>[],
/**
* Course categories
*/
categories: Record<any, any>[],
/**
* Number of course categories
*/
categoriesCount: number,
/**
* Returns `true` if user is enrolling to the course
*/
isEnrolling: boolean
};
/**
* TLessonViewModel
*/
export type TLessonViewModel = {
/**
* Lesson id
*/
id: number,
/**
* Lesson title
*/
title: string,
/**
* Lesson content
*/
content: string,
/**
* Blocks used in the lesson
*/
contentNative: Record<any, any>[],
/**
* Lesson excerpt
*/
excerpt: string,
/**
* Url to lesson
*/
link: string,
/**
* Returns `true` if quiz in the lesson has been completed
*/
quizCompleted: boolean,
lessonQuizzes: Quiz[],
/**
* Returns `true` if lesson has been completed
*/
completed: boolean,
/**
* Returns `true` if lesson requires timer
*/
requireTimer: boolean,
/**
* Timer required time
*/
timerRequiredTime: number,
/**
* User's progress in the lesson
*/
progression: number,
/**
* Returns `true` if logged-in user has access to lesson
*/
hasAccess: boolean,
/**
* Returns `true` if logged-in user has access to lesson's content
*/
hasContentAccess: boolean,
/**
* Number of topics in the lesson
*/
topicsCount: number,
/**
* Url added in video progression of the lesson
*/
videoUrl: string,
/**
* Video details
*/
video: Record<any, any>
};
/**
* Quiz
*/
export type Quiz = {
/**
* Quiz id
*/
id: number,
/**
* Quiz title
*/
title: string,
/**
* Date when quiz was created
*/
date: string,
/**
* Date when quiz was created
*/
date_gmt: string,
/**
* Date when quiz was last modified
*/
modified: string,
/**
* Date when quiz was last modified
*/
modified_gmt: string,
/**
* Slug of url to quiz
* Time limit to take the quiz
*/
timeLimit: number | undefined,
/**
* Quiz content
*/
content: string,
contentNative: Record<any, any>[],
/**
* Name and avatar of author
*/
author: Record<any, any>,
/**
* Link to quiz
*/
link: string | undefined,
/**
* Returns `true` if quiz has been completed
*/
completed: boolean,
/**
* Returns `true` if user has access to the quiz
*/
hasAccess: boolean,
/**
* Returns `true` if user has access to the content of the quiz
*/
hasContentAccess: boolean,
/**
* Returns `true` if user can take the quiz again
*/
canTakeAgain: boolean,
/**
* Returns `true` if answer mark is disabled
*/
disabledAnswerMark: boolean,
/**
* Returns `true` if answer message box should be hidden
*/
hideAnswerMessageBox: boolean,
/**
* Returns `true` if quiz has numbered answers
*/
numberedAnswer: boolean,
/**
* Returns `true` if review question should be shown
*/
showReviewQuestion: boolean,
/**
* Returns `true` if question numbering should be hidden
*/
hideQuestionNumbering: boolean,
/**
* Returns `true` if quiz category should be shown
*/
showCategory: boolean,
/**
* Returns `true` if points per question should be shown
*/
showPoints: boolean,
/**
* Returns `true` if users are forced to answer all questions
*/
forcingQuestionSolve: boolean,
/**
* Returns `true` if quiz title should be hidden
*/
titleHidden: boolean | null,
/**
* Returns `true` if quiz form is activated
*/
formActivated: boolean,
/**
* Returns the position of the form
*/
formShowPosition: number,
/**
* Returns the quiz form
*/
form: boolean | Record<any, any>[],
/**
* Returns `true` if summary button should be hidden
*/
quizSummaryHide: boolean,
/**
* Returns `true` if quiz should start automatically
*/
autoStart: boolean | null,
/**
* Returns data about quiz saving
*/
quizSaving: boolean | Record<any, any>,
/**
* Returns number of seconds allowed for taking the quiz
*/
quizSavingTimeout: number,
/**
* Quiz saved answers
*/
quizSavedAnswers: Record<any, any>,
/**
* Executes an "onClick" function passed to the model
*/
onClick: Function
};
/**
* LearnTopic
*/
export type LearnTopic = {
/**
* Topic id
*/
id: number,
/**
* Topic title
*/
title: Record<any, any>,
/**
* Date created
*/
date: string,
/**
* Date created
*/
date_gmt: string,
/**
* Date modified
*/
modified: string,
/**
* Date modified
*/
modified_gmt: string,
/**
* Link to topic
*/
link: string,
/**
* Topic's url slug
*/
slug: string,
/**
* User id of author
*/
author: number,
/**
* Topic excerpt
*/
excerpt: Record<any, any>,
menu_order: number,
/**
* Returns `true` if user has access
*/
has_course_access: boolean,
/**
* Topic id where quiz is located
*/
topic: number,
/**
* Returns `true` if quiz has been completed
*/
completed: boolean,
/**
* Returns `true` if quiz can be taken again
*/
can_take_again: boolean,
/**
* Returns `true` if logged-in user has access to course's content
*/
has_content_access: boolean,
/**
* Featured media of topic
*/
featured_media: Record<any, any>,
/**
* Course id of topic's parent
*/
course: number,
/**
* Lesson id of topic's parent
*/
lesson: number,
/**
* Id of the next topic
*/
next_topic: number,
/**
* Topic materials
*/
materials: string,
duration: Record<any, any>,
/**
* Url for video progression
*/
video: string,
/**
* Returns `true` if assignment upload is enabled
*/
assignment_upload: boolean,
/**
* Topic category
*/
category: Record<any, any>,
/**
* Topic's tag
*/
tag: Record<any, any>,
/**
* Quizzes associated to the topic
*/
quizzes: Record<any, any>[],
/**
* Course categories
*/
categories: Record<any, any>[],
/**
* Number of course categories
*/
categoriesCount: number,
/**
* Returns `true` if user is enrolling to the course
*/
isEnrolling: boolean
};
/**
* TMember
*/
export type TMember = {
/**
* User id
*/
id: number,
/**
* Name of user
*/
name: string,
/**
* Login name of user
*/
user_login: string,
/**
* Url to user's profile
*/
link: string,
/**
* Member type
*/
member_types: Record<any, any>,
/**
* User's date of registration
*/
registered_date: string,
/**
* User's profile name
*/
profile_name: string,
/**
* User's last activity
*/
last_activity: string,
/**
* Extended profile data
*/
xprofile: Record<any, any>,
/**
* Number of followers
*/
followers: number,
/**
* Number of user's connections
*/
following: number,
/**
* Returns `true` if user is wp admin
*/
is_wp_admin: boolean,
/**
* Friendship status
*/
friendship_status:
| "pending"
| "is_friend"
| "not_friends"
| "awaiting_response",
/**
* User's handle
*/
mention_name: string,
/**
* User's avatars
*/
avatar_urls?: Record<any, any>,
/**
* User's profile cover image
*/
cover_url: string | boolean,
cover_is_default: boolean,
/**
* Gamipress points
*/
points: Record<any, any>,
is_admin: boolean,
/**
* User's points
*/
user_points: Record<any, any>[]
};
/**
* QuestionViewModel
*/
export type QuestionViewModel = {
/**
* Question category
*/
category: string,
/**
* Id of quiz
*/
quizId: number,
/**
* Id of question
*/
id: number,
/**
* Index of question in the quiz
*/
index: number,
/**
* Question title
*/
title: string,
/**
* Title block
*/
titleNative: Record<any, any>[],
/**
* Hint
*/
hint: string,
/**
* Answer options
*/
options: Record<any, any>[],
/**
* Answer data if question is matrix sorting
*/
matrixValues: Record<any, any>[],
/**
* Question type
*/
questionType: string,
/**
* Graded type
*/
gradedType: string,
/**
* Data for resuming a question
*/
resumeData: Record<any, any>
};
/*
* Blog model used by the app that came from Blog API. All fields from api response will also be available in BlogViewModel.
* For more information, refer to: {@link https://www.buddyboss.com/resources/api/#api-Blogs}
*/
export type BlogViewModel = {
/**
* Blog id
*/
id: string,
/**
* Link to the blog post
*/
link: string,
/**
* Blog title
*/
title: string,
/**
* Content of the blog
*/
content: string,
/**
* Blocks used in the blog
*/
contentNative: Record<any, any>[],
/**
* HTML content of the blog
*/
contentHtml: string,
/**
* Name of blog's author
*/
authorName: string,
/**
* Link to author's avatar
*/
avatar: string,
/**
* Date posted
*/
date: string,
/**
* Number of comments in the blog
*/
commentCount: number,
/**
* Returns `true` if blog allows comments
*/
allowComments: boolean,
/**
* Replies posted in the blog
*/
replies: Record<any, any>[],
/**
* If a featured image is set, returns a string link to the featured image.
* Otherwise, will return an integer indicating that `require("../assets/img/default/default-blog-img.png")` is used for the featured image
*/
featuredImage: number | string
};
/**
* Navigation object from "@react-navigation/native"
* @see {@link https://reactnavigation.org/docs/navigation-prop/}
*/
export type NavigationService = {
/**
*
*/
navigate: Function,
/**
*
*/
dispatch: Function,
/**
*
*/
replace: Function,
/**
*
*/
push: Function,
/**
*
*/
pop: Function,
/**
*
*/
goBack: Function,
/**
*
*/
reset: Function,
/**
*
*/
setParams: Function,
/**
*
*/
isFocused: Function,
/**
*
*/
canGoBack: Function,
/**
*
*/
isActive: Boolean
};
/**
* User
*/
export type User = {
/** The user's ID */
id: number,
/** The user's name */
name: string,
/** The user's URL */
url: string,
/** A description of the user */
description: string,
/** The user's link */
link: string,
/** The user's slug */
slug: string,
/** An object containing the user's avatar URLs */
avatar_urls: Record<any, any>,
/** An object containing metadata about the user */
meta: Record<any, any>,
/** An object containing the user's push notification settings */
push_notification_settings: Record<any, any>,
/** The user's "nice" name (lowercase, no spaces, with hyphens) */
nicename: string,
/** An object containing the user's points */
points: Record<any, any>,
/** An object containing the logged-in user's permissions */
loggedin_user_permissions: Record<any, any>,
/** The URL of the user's profile */
bbp_user_profile_url: string,
/** The number of topics started by the user */
topics_started_count: number,
/** The number of replies created by the user */
replies_created_count: number,
/** The user's forum role */
forum_role: string,
/** An array of the user's points */
user_points: Record<any, any>[],
/** An array of the user's achievements */
user_achievements: Record<any, any>[],
/** An array of the user's ranks */
user_ranks: Record<any, any>[],
/** An object containing information about the user's membership */
member_rest: Record<any, any>,
/** The user's login name */
user_login: string,
/** An object containing information about the user's member types */
member_types: Record<any, any>,
/** The date when the user registered */
registered_date: string,
/** The user's profile name */
profile_name: string,
/** The date of the user's last activity */
last_activity: string,
/** An object containing the user's extended profile information */
xprofile: Record<any, any>,
/** The number of followers the user has */
followers: number,
/** The number of users the user is following */
following: number,
/** A boolean value indicating whether the user is a WordPress admin */
is_wp_admin: boolean,
/** The user's friendship status */
friendship_status: string,
/** The ID of the user's friendship (if applicable) */
friendship_id: any,
/** A boolean value indicating whether the user can create a friendship */
create_friendship: boolean,
/** A boolean value indicating whether the user is following the logged-in user */
is_following: boolean,
/** The user's mention name */
mention_name: string,
/** The URL of the user's cover image */
cover_url: string,
/** A boolean value indicating whether the user's cover image is the default */
cover_is_default: boolean,
/** A boolean value indicating whether the user can be reported */
can_report: boolean,
/** A boolean value indicating whether the user has been reported */
reported: boolean,
/** A boolean value indicating whether the logged-in user can report the user */
can_user_report: boolean,
/** A boolean value indicating whether the user has been reported by the logged-in user */
user_reported: boolean
};
/**
*
* TGroupViewModel
*/
export type TGroupViewModel = {
/**
* Returns id of the group parent if available
*/
parentId: number,
/**
* Group id
*/
id: number,
/**
* Group avatar
*/
avatar: string,
/**
* Returns `true` if group has cover image
*/
coverImage: string,
/**
* Returns `true` if cover image is default
*/
coverIsDefault: boolean,
/**
* Returns `true` if logged in user is a member
*/
isMember: boolean,
/**
* Returns `true` if logged in user is an admin
*/
isAdmin: boolean,
/**
* Returns `true` if logged in user is the creator of the group
*/
isAuthor: boolean,
/**
* Returns `true` if logged in user is assigned as a moderator
*/
isMod: boolean,
/**
* Returns `true` if logged in user is assigned as an organizer
*/
isSoloOrganizer: boolean,
/**
* Returns `true` if logged in user is not an admin
*/
notAdmin: boolean,
/**
* Returns the invite id if logged in user has been invited to join. Otherwise, will return `false`
*/
inviteId: number | boolean,
/**
* Returns `true` if group can be reported
*/
can_report: boolean,
/**
* Returns `true` if group has already been reported
*/
reported: boolean,
/**
* Returns request id if logged in user is trying to join the group. Otherwise, will return `false`
*/
requestId: number | boolean,
/**
* Group title
*/
title: string,
/**
* Group description
*/
content: string,
/**
* Group description rendered
*/
contentRendered: string,
/**
* Group short description
*/
shortContent: string,
/**
* Returns `true` if group has associated forum
*/
hasForum: boolean,
/**
* Number of members in the group
*/
membersCount: number,
/**
* Group visibility. Ex: `public`, `hidden`
*/
status: string,
admins: Array<TMember>,
/**
* Role of logged in user
*/
role: string,
/**
* Role label of logged in user
*/
roleLabel: string,
/**
* Group type
*/
type: string,
subgroupIds: number[],
/**
* Function to navigate to group link in web
*/
navigateToWeb: Function,
/**
* Function to navigate to group's forum
*/
navigateToForum?: Function,
/**
* Toggle subscription to group
*/
subscribeClick?: Function,
/**
* Function to get all fields given by api. Ex: `const group = getGroup(g => g)`.
*/
getGroup: Function,
/**
* Returns `true` if logged in user can post
*/
canPost: boolean,
/**
* Returns `true` if logged in user can join
*/
canJoin: boolean,
/**
* Returns `true` if logged in user can create media
*/
canCreateMedia: boolean,
/**
* Returns `true` if logged in user can create document
*/
canCreateDocument: boolean,
/**
* Function to navigate to group item
*/
onClick: Function
};
export type TMemberViewModel = {
/**
* Id of member
*/
id: number,
/**
* Returns `true` if member is not the user logged in
*/
someoneelse: boolean,
/**
* Full name of user
*/
fullname: string,
/**
* Url to user's avatar
*/
avatarUrl: string,
/**
* Url to user's full avatar image
*/
avatarFull: string,
/**
* Returns friend status
*/
friendStatus: string,
/**
* Returns a nice name format of user's name
*/
nicename: string,
/**
* Returns the friendship id between logged in user and user loaded in the model
*/
friendshipId: number | null,
/**
* Returns last activity of user
*/
lastActivity: string,
/**
* Can be used to redirect to user's profile
*/
onClick: () => void,
/**
* Url to user's cover image
*/
coverSrc: string,
/**
* Points associated to user
*/
points: number,
/**
* User points information
*/
userPoints: any[],
/**
* User type
*/
type: string,
/**
* Date when the user registered
*/
registeredDate: string,
/**
* Date when the user joined the group
*/
groupJoiningDate: string,
/**
* Number of followers
*/
followers: number,
/**
* Number of persons that the user is following
*/
following: number,
/**
* Returns `true` if user can be reported
*/
can_report: boolean,
/**
* Returns `true` if user has already been reported
*/
reported: boolean,
/**
* inviter Inviter member details
*/
inviter: TMemberViewModel
};
/**
* Helper function to translate string
* @return {string}
*/
export type TTranslationFunction = (
arg0: string,
arg1?: Record<any, any>
) => string;
/**
* WebSource
*/
export type WebSource = {
headers: Record<any, any>,
uri: string
};
/**
* Lesson
*/
export type Lesson = {
/**
* Lesson id
*/
id: number,
/**
* Lesson title
*/
title: Record<any, any>,
/**
* Lesson content
*/
content: Record<any, any>,
/**
* Date created
*/
date: string,
/**
* Date created
*/
date_gmt: string,
/**
* Date modified
*/
modified: string,
/**
* Date modified
*/
modified_gmt: string,
/**
* Url to lesson
*/
link: string,
/**
* Lesson's url slug
*/
slug: string,
/**
* User id of author
*/
author: number,
/**
* Lesson excerpt
*/
excerpt: Record<any, any>,
menu_order: number,
/**
* Returns `true` if user has access
*/
has_course_access: boolean,
/**
* Returns `true` if logged-in user has access to lessons's content
*/
has_content_access: boolean,
/**
* Featured media of lesson
*/
featured_media: Record<any, any>,
/**
* Course id of lessons's parent
*/
course: number,
/**
* Next lesson's id
*/
next_lesson: number,
duration: Record<any, any>,
/**
* Lesson materials
*/
materials: string,
/**
* Url for video progression
*/
video: string,
/**
* Returns `true` if f upload is enabled
*/
assignment_upload: boolean,
is_sample: boolean,
/**
* Topics associated to the lesson
*/
topics: Record<any, any>[],
/**
* Quizzes associated to the lesson
*/
quizzes: Record<any, any>[],
/**
* Returns `true` if topic has been completed
*/
completed: boolean,
/**
* Returns `true` if quiz in the lesson has been completed
*/
quiz_completed: boolean,
settings: Record<any, any>,
/**
* Returns `true` if lesson can be marked as completed
*/
can_complete: boolean,
error_message: Record<any, any>[],
excerpt_native: Record<any, any>,
/**
* Blocks in the lesson
*/
content_native: Record<any, any>,
_links: Record<any, any>,
_embedded: Record<any, any>
};
/**
* TLearnTopicViewModel
*/
export type TLearnTopicViewModel = {
/**
* Topic id
*/
id: number,
/**
* Topic title
*/
title: string,
/**
* Blocks in the topic
*/
contentNative: Record<any, any>,
/**
* Topic content
*/
content: string,
/**
* Topic author
*/
author: Record<any, any>,
/**
* Video progression
*/
video: Record<any, any>,
/**
* Link to topic
*/
link: string,
/**
* Url of the video used in video progression
*/
videoUrl: string,
/**
* Order number of topic
*/
order: number,
/**
* Number of topics
*/
total: number,
lessonProgress: number,
/**
* Returns `true` if topic has been marked as complete
*/
completed: boolean,
/**
* Returns `true` if assignment upload is enabled
*/
assignment_upload: boolean,
/**
* Quizzes associated to the topic
*/
quizzes: Record<any, any>[],
/**
* Returns `true` if timer should be shown
*/
requiredTimer: boolean,
/**
* Duration of timer
*/
duration: number,
settings: Record<any, any>,
/**
* Date created
*/
date: string
};
Source