import { IArcGISContext } from "../types/IArcGISContext"; import { IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior"; import { IWithStoreBehavior } from "../core/behaviors/IWithStoreBehavior"; import { IEditorConfig } from "../core/schemas/types"; import { IEntityEditorContext } from "../core/types/HubEntityEditor"; import { IHubChannel, IHubChannelEditor } from "../core/types/IHubChannel"; import { ChannelEditorType } from "./_internal/channelEditorTypes"; import { IConvertToCardModelOpts, IHubCardViewModel } from "../core/types/IHubCardViewModel"; export declare class HubChannel implements IWithStoreBehavior, IWithEditorBehavior { protected context: IArcGISContext; protected entity: IHubChannel; protected isDestroyed: boolean; constructor(entity: IHubChannel, context: IArcGISContext); /** * Create an instance from an IHubChannel object * @param json - JSON object to create a HubChannel from * @param context - ArcGIS context * @returns a HubChannel instance */ static fromJson(json: Partial, context: IArcGISContext): HubChannel; /** * Create a new HubChannel, returning a HubChannel instance. * Note: This does not persist the Channel into the backing store * @param partialChannel A partial IHubChannel object * @param context ArcGIS Context * @returns a HubChannel instance */ static create(partialChannel: Partial, context: IArcGISContext, save?: boolean): Promise; /** * Fetch a Channel from the backing store and return a HubChannel instance. * @param identifier - Identifier of the channel to load * @param context - An IArcGISContext object * @returns a HubChannel instance */ static fetch(identifier: string, context: IArcGISContext): Promise; /** * Given a partial channel, apply defaults to it to ensure that a baseline of properties are set * @param partialChannel A partial IHubChannel object * @param context - ArcGIS Context * @returns an IHubChannel object */ private static applyDefaults; /** * Can the current user edit the channel? * @returns boolean */ get canEdit(): boolean; /** * Can the current user delete the channel? * @returns boolean */ get canDelete(): boolean; /** * The orgId of the channel * @returns the orgId of the channel */ get orgId(): string; /** * Return the backing entity as an object literal * @returns an IHubChannel */ toJson(): IHubChannel; /** * Apply a new state to the instance * @param changes A partial IHubChannel object */ update(changes: Partial): void; /** * Save the HubChannel to the backing store. * @returns a promise */ save(): Promise; /** * Delete the HubChannel from the store * set a flag to indicate that it is destroyed * @returns a promise */ delete(): Promise; /** * TODO * @param opts * @returns */ convertToCardModel(_opts?: IConvertToCardModelOpts): IHubCardViewModel; /** * Get a specifc editor config for the HubChannel entity. * @param i18nScope A string representing the i18n scope for translated strings * @param type One of the supported ChannelEditorType strings * @returns a promise that resolves a IEditorConfig object */ getEditorConfig(i18nScope: string, type: ChannelEditorType): Promise; /** * Return the channel as an editor object * @param editorContext An IEntityEditorContext object * @param include An optional array of includes * @returns a promise that resolves an IHubChannelEditor object */ toEditor(_editorContext: IEntityEditorContext, _include?: string[]): Promise; /** * Load the channel from the editor object * @param editor An IHubChannelEditor object * @returns a promise that resolves an IHubChannel */ fromEditor(editor: IHubChannelEditor): Promise; }