1
0
mirror of synced 2024-11-25 14:56:03 +03:00

fix: Typehints for modelGetConverter / modelSetConverter

This commit is contained in:
Zaytsev Kirill 2020-11-13 12:49:58 +03:00
parent 50d0516a28
commit 7a6fc72839

View File

@ -28,6 +28,16 @@ const VALIDATION_BEHAVIOR = {
SUBMIT: 'submit',
}
interface ModelGetConverter {
<U, T>(value: U|Empty): U|T|Empty;
}
interface ModelSetConverter {
<T, U>(curr: U|T, prev: U|Empty): U|T;
}
type Empty = null | undefined
@Component({ name: 'FormularioInput', inheritAttrs: false })
export default class FormularioInput extends Vue {
@Inject({ default: undefined }) formularioSetter!: Function|undefined
@ -57,8 +67,8 @@ export default class FormularioInput extends Vue {
// Affects only observing & setting of local errors
@Prop({ default: false }) errorsDisabled!: boolean
@Prop({ default: () => value => value }) modelGetConverter!: Function
@Prop({ default: () => value => value }) modelSetConverter!: Function
@Prop({ default: () => <U, T>(value: U|Empty): U|T|Empty => value }) modelGetConverter!: ModelGetConverter
@Prop({ default: () => <T, U>(value: U|T): U|T => value }) modelSetConverter!: ModelSetConverter
public proxy: any = this.getInitialValue()