@metamask/snaps-simulation
Version:
A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment
24 lines • 1.23 kB
text/typescript
import type { PayloadAction } from "@reduxjs/toolkit";
import type { ApplicationState } from "./store.cjs";
import type { JsonRpcMockImplementation } from "../types.cjs";
export type JsonRpcMock = {
id: string;
implementation: JsonRpcMockImplementation;
once?: boolean;
};
export type MocksState = {
jsonRpc: Record<string, Omit<JsonRpcMock, 'id'>>;
};
export declare const mocksSlice: import("@reduxjs/toolkit").Slice<MocksState, {
addJsonRpcMock: (state: import("immer/dist/internal.js").WritableDraft<MocksState>, action: PayloadAction<JsonRpcMock>) => void;
removeJsonRpcMock: (state: import("immer/dist/internal.js").WritableDraft<MocksState>, action: PayloadAction<string>) => void;
}, "mocks">;
export declare const addJsonRpcMock: import("@reduxjs/toolkit").ActionCreatorWithPayload<JsonRpcMock, "mocks/addJsonRpcMock">, removeJsonRpcMock: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "mocks/removeJsonRpcMock">;
/**
* Get the JSON-RPC mocks from the state.
*
* @param state - The application state.
* @returns The JSON-RPC mocks.
*/
export declare const getJsonRpcMocks: (state: ApplicationState) => Record<string, Omit<JsonRpcMock, "id">>;
//# sourceMappingURL=mocks.d.cts.map