UNPKG

@shko.online/componentframework-mock

Version:

Mocking library to help with testing PowerApps Component Framework Components

45 lines (44 loc) 2.08 kB
/// <reference types="powerapps-component-framework" /> import type { SinonSpiedInstance, SinonStub } from 'sinon'; import type { ComponentValues, MockGenerator, MockGeneratorOverrides } from './MockGenerator'; import type { MockToRaw, PropertyMap, PropertyToMock } from '../ComponentFramework-Mock'; import type { ShkoOnline } from '../ShkoOnline'; import { MetadataDB } from './Metadata.db'; import { ContextMock } from '../ComponentFramework-Mock'; /** * This class mocks the standard version of the PowerApps Component Framework control. */ export declare class ComponentFrameworkMockGenerator<TInputs extends ShkoOnline.PropertyTypes<TInputs>, TOutputs extends ShkoOnline.KnownTypes<TOutputs>> implements MockGenerator<TInputs, TOutputs> { _PendingUpdates: { value: ComponentFramework.LookupValue | ComponentValues<TInputs>; table: string; column: string; row?: string; }[]; RefreshDatasets: SinonStub<[ ], void>; RefreshParameters: SinonStub<[ ], void>; SetControlResource: SinonStub<[ /*resource*/ string ], void>; UpdateValues: SinonStub<[ /*items*/ Partial<MockToRaw<TInputs, PropertyToMock<TInputs>>> ], void>; container: HTMLDivElement; context: ContextMock<TInputs>; control: SinonSpiedInstance<ComponentFramework.StandardControl<TInputs, TOutputs>>; metadata: MetadataDB; notifyOutputChanged: SinonStub<[ ], void>; onOutputChanged: SinonStub<[ /*updates*/ Partial<TOutputs> ], void>; outputOnlyProperties: ShkoOnline.OutputOnlyTypes<TInputs, TOutputs>; resizeObserver: ResizeObserver; state: ComponentFramework.Dictionary; constructor(control: new () => ComponentFramework.StandardControl<TInputs, TOutputs>, inputs: PropertyMap<TInputs>, container?: HTMLDivElement, outputs?: ShkoOnline.OutputOnlyTypes<{}, TOutputs>, overrides?: MockGeneratorOverrides); ExecuteInit(): void; ExecuteUpdateView(): void; } //# sourceMappingURL=ComponentFramework-Mock-Generator.d.ts.map