UNPKG

@salesforce/plugin-org

Version:

Commands to interact with Salesforce orgs

24 lines (23 loc) 915 B
import type { AuthFields } from '@salesforce/core'; import { Command, Interfaces, Hook } from '@oclif/core'; type HookOpts<T> = { options: { Command: Command.Class; argv: string[]; commandId: string; }; return: T | undefined; }; export type OrgCreateResult = Pick<AuthFields, 'accessToken' | 'clientId' | 'created' | 'createdOrgInstance' | 'devHubUsername' | 'expirationDate' | 'instanceUrl' | 'loginUrl' | 'orgId' | 'username'>; type PostOrgCreateOpts = HookOpts<OrgCreateResult>; /** * Extends OCLIF's Hooks interface to add types for hooks that run on org commands */ export type OrgHooks = { postorgcreate: PostOrgCreateOpts; } & Interfaces.Hooks; export type OrgHook<T> = (this: Hook.Context, options: T extends keyof Interfaces.Hooks ? OrgHooks[T] : T) => any; export declare namespace OrgHook { type PostOrgCreate = Hook<OrgHooks['postorgcreate']>; } export {};