import { Octokit } from '@octokit/rest'; declare enum CortexProtocolMessageType { Context = "context", Fetch = "fetch", Init = "init" } interface IPluginMessage { type: CortexProtocolMessageType; } declare enum PluginContextLocation { Entity = "ENTITY", Global = "GLOBAL" } interface ProxyFetchRequestMessage extends IPluginMessage { init?: RequestInit; input: RequestInfo; type: CortexProtocolMessageType.Fetch; } interface GetContextRequestMessage extends IPluginMessage { type: CortexProtocolMessageType.Context; } interface PluginInitMessage extends IPluginMessage { type: CortexProtocolMessageType.Init; } type PluginMessage = PluginInitMessage | ProxyFetchRequestMessage | GetContextRequestMessage; declare function postCortexMessage(message: PluginMessage): Promise; declare enum CortexUserRoleType { BASIC = "BASIC", CUSTOM = "CUSTOM" } declare enum CortexBasicUserRole { MANAGER = "MANAGER", OWNER = "OWNER", USER = "USER", VIEWER = "VIEWER" } interface CortexUserBasicRole { role: CortexBasicUserRole; type: CortexUserRoleType.BASIC; } interface CortexUserCustomRole { name: string; tag: string; type: CortexUserRoleType.CUSTOM; } type CortexUserRole = CortexUserBasicRole | CortexUserCustomRole; interface CortexUser { email: string; name: string; roles?: CortexUserRole[]; } interface CortexCatalogEntityIcon { kind: string; tag: string; url: string; } interface CortexEmailOwner { description: string | null; email: string; } interface PluginEntityOwnership { emails: CortexEmailOwner[]; } interface CortexCatalogEntity { definition: any | null; description: string | null; groups: string[] | null; name: string | null; ownership: PluginEntityOwnership; tag: string; type: string; } interface CortexService extends CortexCatalogEntity { type: 'service'; } interface CortexResource extends CortexCatalogEntity { type: string; } interface CortexDomain extends CortexCatalogEntity { type: 'domain'; } interface CortexContextResponse { apiBaseUrl: string; entity: CortexDomain | CortexResource | CortexService | null; location: PluginContextLocation; style: Record; tag: string; theme: string; user: CortexUser; } interface CortexFetchResponse { body: string | undefined; headers: Record; ok: boolean; redirected: boolean; status: number; statusText: string; trailer: Record; type: ResponseType; url: string; } interface ICortexApi { getContext: () => Promise; pluginInit: () => void; proxyFetch: (input: RequestInfo, init?: RequestInit) => Promise; } declare const CortexApi: ICortexApi; declare const plugin: (octokit: Octokit, { CortexApi }: { CortexApi: ICortexApi; }) => void; export { CortexApi, CortexBasicUserRole, CortexCatalogEntity, CortexCatalogEntityIcon, CortexContextResponse, CortexDomain, CortexEmailOwner, CortexFetchResponse, CortexProtocolMessageType, CortexResource, CortexService, CortexUser, CortexUserBasicRole, CortexUserCustomRole, CortexUserRole, CortexUserRoleType, GetContextRequestMessage, ICortexApi, IPluginMessage, PluginContextLocation, PluginEntityOwnership, PluginInitMessage, ProxyFetchRequestMessage, plugin as octokitPlugin, postCortexMessage };