UNPKG

guilded.ts

Version:

A powerful NPM module that allows you to easily interact with the Guilded API.

147 lines 5.97 kB
import { APIListItem, APIListItemSummary, APIMentions } from 'guilded-api-typings'; import { Base } from '../Base'; import { ListItemNote } from './ListItemNote'; import { ListChannel } from '../channel/ListChannel'; import { FetchOptions } from '../../managers/BaseManager'; /** * Represents a list item on Guilded. * @example new ListItem(channel, rawItem); */ export declare class ListItem extends Base { readonly channel: ListChannel; readonly raw: APIListItem | APIListItemSummary; /** The ID of the server the list item belongs to. */ readonly serverId: string; /** The ID of the channel the list item belongs to. */ readonly channelId: string; /** The message of the list item. */ readonly message: string; /** The mentions of the list item. */ readonly mentions?: APIMentions; /** The date the list item was created. */ readonly createdAt: Date; /** The ID of the user that created the list item. */ readonly createdBy: string; /** The ID of the webhook that created the list item. */ readonly createdByWebhookId?: string; /** The date the list item was edited. */ readonly editedAt?: Date; /** The ID of the user that edited the list item. */ readonly editedBy?: string; /** The ID of the list item the list item belongs to. */ readonly parentId?: string; /** The date the list item was completed. */ readonly completedAt?: Date; /** The ID of the user that completed the list item. */ readonly completedBy?: string; /** The note of the list item. */ readonly note?: ListItemNote; /** * @param channel The list channel the item belongs to. * @param raw The raw data of the list item. * @param cache Whether to cache the list item. */ constructor(channel: ListChannel, raw: APIListItem | APIListItemSummary, cache?: boolean); /** Whether the list item is cached. */ get isCached(): boolean; /** The server the list item belongs to. */ get server(): import("../..").Server | undefined; /** The timestamp the list item was created. */ get createdTimestamp(): number; /** The server member that created the list item. */ get author(): import("../..").ServerMember | undefined; /** The webhook that created the list item. */ get webhook(): import("../Webhook").Webhook | undefined; /** The ID of the user that created the list item. */ get authorId(): string; /** The timestamp the list item was edited. */ get editedTimestamp(): number | undefined; /** The server member that edited the list item. */ get editor(): import("../..").ServerMember | undefined; /** The list item the list item belongs to. */ get parent(): ListItem | undefined; /** The timestamp the list item was completed. */ get completedTimestamp(): number | undefined; /** The server member that completed the list item. */ get completer(): import("../..").ServerMember | undefined; /** Whether the list item is completed. */ get isCompleted(): boolean; /** Whether the list item is editable. */ get isEditable(): boolean; /** * Fetch the list item. * @param options The options to fetch the list item with. * @returns The fetched list item. * @example listItem.fetch(); */ fetch(options?: FetchOptions): Promise<this>; /** * Fetch the server the list item belongs to. * @param options The options to fetch the server with. * @returns The fetched server. * @example listItem.fetchServer(); */ fetchServer(options?: FetchOptions): Promise<import("../..").Server>; /** * Fetch the server member that created the list item. * @param options The options to fetch the server member with. * @returns The fetched server member. * @example listItem.fetchAuthor(); */ fetchAuthor(options?: FetchOptions): Promise<import("../..").ServerMember>; /** * Fetch the webhook that created the list item. * @param options The options to fetch the webhook with. * @returns The fetched webhook. * @example listItem.fetchWebhook(); */ fetchWebhook(options?: FetchOptions): Promise<import("../Webhook").Webhook> | undefined; /** * Fetch the server member that edited the list item. * @param options The options to fetch the server member with. * @returns The fetched server member. * @example listItem.fetchEditor(); */ fetchEditor(options?: FetchOptions): Promise<import("../..").ServerMember | undefined>; /** * Fetch the list item the list item belongs to. * @param options The options to fetch the list item with. * @returns The fetched list item. * @example listItem.fetchParent(); */ fetchParent(options?: FetchOptions): Promise<ListItem | undefined>; /** * Fetch the server member that completed the list item. * @param options The options to fetch the server member with. * @returns The fetched server member. * @example listItem.fetchCompleter(); */ fetchCompleter(options?: FetchOptions): Promise<import("../..").ServerMember | undefined>; /** * Edit the list item. * @param message The message of the list item. * @param note The note of the list item. * @returns The edited list item. * @example listItem.edit('Hello World!'); */ edit(message: string, note?: string): Promise<this>; /** * Remove the list item. * @returns The removed list item. * @example listItem.remove(); */ remove(): Promise<this>; /** * Complete the list item. * @returns The completed list item. * @example listItem.complete(); */ complete(): Promise<this>; /** * Uncomplete the list item. * @returns The uncompleted list item. * @example listItem.uncomplete(); */ uncomplete(): Promise<this>; } //# sourceMappingURL=ListItem.d.ts.map