@payloadcms/plugin-multi-tenant
Version:
Multi Tenant plugin for Payload
37 lines • 1.2 kB
TypeScript
import type { OptionObject } from 'payload';
import React from 'react';
type ContextType = {
/**
* Array of options to select from
*/
options: OptionObject[];
/**
* The currently selected tenant ID
*/
selectedTenantID: number | string | undefined;
/**
* Prevents a refresh when the tenant is changed
*
* If not switching tenants while viewing a "global", set to true
*/
setPreventRefreshOnChange: React.Dispatch<React.SetStateAction<boolean>>;
/**
* Sets the selected tenant ID
*
* @param args.id - The ID of the tenant to select
* @param args.refresh - Whether to refresh the page after changing the tenant
*/
setTenant: (args: {
id: number | string | undefined;
refresh?: boolean;
}) => void;
};
export declare const TenantSelectionProviderClient: ({ children, initialValue, tenantCookie, tenantOptions, }: {
children: React.ReactNode;
initialValue?: number | string;
tenantCookie?: string;
tenantOptions: OptionObject[];
}) => React.JSX.Element;
export declare const useTenantSelection: () => ContextType;
export {};
//# sourceMappingURL=index.client.d.ts.map