I have a function signature in an interface which I'd like to use as the signature for a callback parameter in some class.
export interface IGrid {
gridFormat(gridCell: GridCell, grid: Grid): boolean
}
I'd like to do something like this:
validateFormat(validator: IGrid.gridFormat) {
// ...
}
Is this possible?
Is this possible?
Yes as shown below:
export interface IGrid {
gridFormat(gridCell: GridCell, grid: Grid): boolean
}
function validateFormat(validator: IGrid['gridFormat']) { // MAGIC 🌹
// ...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With