Closed
Description
I'm creating a state in Typescript like this:
state: {
name: 'mainState.import',
url: '/import',
reloadOnSearch: false,
onEnter: (['$uibModal', (uibModal: ng.ui.bootstrap.IModalService) => {
let modalOptions: any = {
headerText: 'Import State goes here'
};
...
uibModal.open(modalConfig);
}])
}
While it works fine I get a typescript compilation error:
[0] (14,14): error TS2322: Type '({ name: string; icon: string; keyboardShortcut: string; state: { name: string; component: string...' is not assignable to type 'ISidebarPage[]'.
[0] Type '{ name: string; icon: string; keyboardShortcut: string; state: { name: string; component: string;...' is not assignable to type 'ISidebarPage'.
[0] Type '{ name: string; icon: string; accessibleForRoles: string[]; state: { name: string; url: string; r...' is not assignable to type 'ISidebarPage'.
[0] Types of property 'state' are incompatible.
[0] Type '{ name: string; url: string; reloadOnSearch: boolean; onEnter: (string | ((uibModal: IModalServic...' is not assignable to type 'StateDeclaration & { component?: string; template?: string; }'.
[0] Type '{ name: string; url: string; reloadOnSearch: boolean; onEnter: (string | ((uibModal: IModalServic...' is not assignable to type 'StateDeclaration'.
[0] Types of property 'onEnter' are incompatible.
[0] Type '(string | ((uibModal: IModalService) => void))[]' is not assignable to type 'TransitionStateHookFn'.
[0] Type '(string | ((uibModal: IModalService) => void))[]' provides no match for the signature '(transition: Transition, state: State): boolean | TargetState | void | Promise<boolean | TargetState | void>'
Is this some sort of bug with the typings?
Metadata
Metadata
Assignees
Labels
No labels