Édouard Lopez
01/16/2023, 11:39 AMstateHandlers map. The following:
import { …, StateHandlers } from '@pact-foundation/pact'
…
stateHandlers: {
'Customers are available': (state, params) => Promise.resolve(),
} as StateHandlers,
Give this error
Type 'StateHandlers' is not assignable to type 'StateHandlers & StateHandlers'.
Type 'import("/workspaces/ms.pact-provider-example-for-typescript/node_modules/@pact-foundation/pact/src/dsl/message").StateHandlers' is not assignable to type 'import("/workspaces/ms.pact-provider-example-for-typescript/node_modules/@pact-foundation/pact/src/dsl/verifier/proxy/types").StateHandlers'.
'string' index signatures are incompatible.
Type '(state: string, params?: { [name: string]: string; } | undefined) => Promise<unknown>' is not assignable to type 'StateHandler'.
Type '(state: string, params?: { [name: string]: string; } | undefined) => Promise<unknown>' is not assignable to type 'StateFunc'.
Types of parameters 'state' and 'parameters' are incompatible.
Type 'AnyJson | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.ts(2322)
types.d.ts(42, 5): The expected type comes from property 'stateHandlers' which is declared here on type 'VerifierOptions'