|
|
|
|
|
by crooked-v
2296 days ago
|
|
A simple TypeScript example: interface DuckTypedObject {
quack: true
bark?: false
eyes: 'beady'
}
This will require that any object used as a DuckTypedObject must have the `quack` and `eyes` properties and may optionally have a `bark` of `false`, but doesn't otherwise prescribe what the object actually has to be. |
|