1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/project-static/src/global.d.ts

69 lines
1.3 KiB
TypeScript
Raw Normal View History

type Primitives = string | number | boolean | undefined | null;
type JSONAble = Primitives | Primitives[] | { [k: string]: JSONAble } | JSONAble[];
2021-03-13 02:31:57 -07:00
type Nullable<T> = T | null;
type APIAnswer<T> = {
count: number;
next: Nullable<string>;
previous: Nullable<string>;
results: T[];
};
type ErrorBase = {
2021-03-13 02:31:57 -07:00
error: string;
};
type APIError = {
2021-03-13 02:31:57 -07:00
exception: string;
netbox_version: string;
python_version: string;
} & ErrorBase;
2021-03-13 02:31:57 -07:00
type APIObjectBase = {
id: number;
display?: string;
2021-03-13 02:31:57 -07:00
name: string;
url: string;
[k: string]: JSONAble;
2021-03-13 02:31:57 -07:00
};
2021-04-13 21:51:12 -07:00
type APIKeyPair = {
public_key: string;
private_key: string;
};
type APIReference = {
2021-03-13 02:31:57 -07:00
id: number;
name: string;
slug: string;
url: string;
_depth: number;
};
2021-03-13 02:31:57 -07:00
type APISecret = {
assigned_object: APIObjectBase;
assigned_object_id: number;
assigned_object_type: string;
created: string;
custom_fields: Record<string, unknown>;
display: string;
hash: string;
id: number;
last_updated: string;
name: string;
plaintext: Nullable<string>;
role: APIObjectBase;
tags: number[];
url: string;
};
2021-03-13 02:31:57 -07:00
interface ObjectWithGroup extends APIObjectBase {
group: Nullable<APIReference>;
}
declare const messages: string[];
type FormControls = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;