dashboard-core/.d.ts

336 lines
5.7 KiB
TypeScript
Raw Permalink Normal View History

2023-07-05 00:42:49 +05:00
declare module "dashboard-core" {
2023-06-22 19:36:52 +05:00
let Dashboard: any
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
const formTypes: formTypes
const customPagesTypes: customPagesTypes
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
const version: string
2023-06-19 12:35:11 +05:00
}
interface RateLimitSettingsObject {
2023-06-22 19:36:52 +05:00
windowMs: Number
max: Number
message: String
store?: any
2023-06-19 12:35:11 +05:00
}
interface Dashboard {
2023-06-22 19:36:52 +05:00
new(config: {
port: number
client: {
id: string
secret: string
}
redirectUri: string
domain: string
bot: any
theme: any
settings: category[]
ownerIDs: array,
useTheme404: boolean,
useThemeMaintenance: boolean,
noCreateServer?: boolean
SSL?: {
enabled: boolean
key: string
cert: string
}
rateLimits?: {
manage?: RateLimitSettingsObject
guildPage?: RateLimitSettingsObject
settingsUpdatePostAPI?: RateLimitSettingsObject
discordOAuth2?: RateLimitSettingsObject
}
invite?: {
clientId: string
scopes: object
permissions: string
redirectUri: string
otherParams: string
}
supportServer?: {
slash: string
inviteUrl: string
}
guildAfterAuthorization?: {
use: boolean
guildId: string
options?: {
nickname?: string
roles?: [string]
mute?: boolean
deaf?: boolean
}
}
reportError?: (where: string, what: any) => any
assistantsSecureStorageKey?: string
}): any
DBDEvents: () => any
init: () => Promise<any>
getApp: () => any
useThirdPartyModule: (module: any) => any
2023-06-19 12:35:11 +05:00
}
interface category {
2023-06-22 19:36:52 +05:00
categoryId: string
categoryName: string
categoryDescription: string
categoryOptionsList: option[]
2023-06-19 12:35:11 +05:00
}
interface option {
2023-06-22 19:36:52 +05:00
optionId?: string
optionName?: string
optionDescription?: string
title?: string
description?: string
optionType:
| {
type: string
data?: string | null
function?: any
min?: number | null
max?: number | null
disabled?: boolean | null
required?: boolean | null
themeOptions?: object | null
}
| string
getActualSet?: (options: optionOptions) => Promise<any>
setNew?: (options: optionOptions) => Promise<any>
allowedCheck?: (options: allowedCheckOption) => Promise<any>
themeOptions?: Object
2023-06-19 12:35:11 +05:00
}
interface optionOptions {
2023-06-22 19:36:52 +05:00
guild: { id: string }
user: { id: string }
newData: any
2023-06-19 12:35:11 +05:00
}
interface allowedCheckOption {
2023-06-22 19:36:52 +05:00
guild: { id: string }
user: { id: string }
2023-06-19 12:35:11 +05:00
}
interface formTypes {
2023-06-22 19:36:52 +05:00
select: (
list: object,
disabled?: boolean,
themeOptions?: object
) => {
type: string
data: {
keys: object
values: object
}
disabled: boolean
themeOptions: object
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
multiSelect: (
list: object,
disabled?: boolean,
required?: boolean,
themeOptions?: object
) => {
type: string
data: {
keys: object
values: object
}
disabled: boolean | null
required: boolean | null
themeOptions: object
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
input: (
placeholder?: string,
min?: number,
max?: number,
disabled?: boolean,
required?: boolean,
themeOptions?: object
) => {
type: string
data: string | null
min: number | null
max: number | null
disabled: boolean | null
required: boolean | null
themeOptions: object | null
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
textarea: (
placeholder?: string,
min?: number,
max?: number,
disabled?: boolean,
required?: boolean,
themeOptions?: object
) => {
type: string
data: string | null
min: number | null
max: number | null
disabled: boolean | null
required: boolean | null
themeOptions: object | null
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
switch: (
disabled?: boolean,
themeOptions?: object
) => {
type: string
disabled: boolean
themeOptions: object
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
checkbox: (
disabled?: boolean,
themeOptions?: object
) => {
type: string
disabled: boolean
themeOptions: object
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
channelsSelect: (
disabled?: boolean,
channelTypes?: string[],
hideNSFW?: boolean,
onlyNSFW?: boolean,
hideNoAccess?: boolean,
themeOptions?: object
) => {
type: string
function: (client: string, guildid: string) => any
disabled: boolean
themeOptions: object
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
channelsMultiSelect: (
disabled?: boolean,
required?: boolean,
channelTypes?: string[],
hideNSFW?: boolean,
onlyNSFW?: boolean,
hideNoAccess?: boolean,
themeOptions?: object
) => {
type: string
function: (client: string, guildid: string) => any
disabled: boolean
required: boolean
themeOptions: object
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
rolesSelect: (
includeBots: boolean,
disabled?: boolean,
hideHigherRoles?: boolean,
themeOptions?: object
) => {
type: string
function: (client: string, guildid: string) => any
disabled: boolean
themeOptions: object
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
rolesMultiSelect: (
includeBots: boolean,
disabled?: boolean,
required?: boolean,
hideHigherRoles?: boolean,
themeOptions?: object
) => {
type: string
function: (client: string, guildid: string) => any
disabled: boolean
required: boolean
themeOptions: object
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
colorSelect: (
defaultState: string,
disabled?: boolean,
themeOptions?: object
) => {
type: string
data: string
disabled: boolean
themeOptions: object
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
embedBuilder: (
defaultSettings: object,
themeOptions?: object
) => {
type: string
data: object
themeOptions: object
}
2023-06-19 12:35:11 +05:00
}
interface EmbedBuilder {
2023-06-22 19:36:52 +05:00
content?: string
embed: {
title?: string
description: string
color?: string | number
timestamp?: any
url?: string
author?: {
name?: string
url?: string
icon_url?: string
}
thumbnail?: {
url?: string
}
image?: {
url?: string
}
footer?: {
text?: string
icon_url?: string
}
fields?: EmbedBuilderField[]
}
2023-06-19 12:35:11 +05:00
}
interface EmbedBuilderField {
2023-06-22 19:36:52 +05:00
name?: string
value?: string
inline?: boolean
2023-06-19 12:35:11 +05:00
}
interface customPagesTypes {
2023-06-22 19:36:52 +05:00
redirectToUrl: (
endpoint: string,
getDataFunction: any
) => {
type: string
endpoint: string
getEndpoint: any
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
renderHtml: (
endpoint: string,
getDataFunction: any
) => {
type: string
endpoint: string
getHtml: any
}
2023-06-19 12:35:11 +05:00
2023-06-22 19:36:52 +05:00
sendJson: (
endpoint: string,
getDataFunction: any
) => {
type: string
endpoint: string
getJson: any
}
}