(
parameter: AST,
type: AST
)
| 2032 | readonly type: AST |
| 2033 | |
| 2034 | constructor( |
| 2035 | parameter: AST, |
| 2036 | type: AST |
| 2037 | ) { |
| 2038 | if (!isIndexSignatureParameter(parameter)) { |
| 2039 | throw new Error(`Invalid index signature parameter ${parameter._tag}`) |
| 2040 | } |
| 2041 | this.parameter = parameter |
| 2042 | this.type = type |
| 2043 | if (isOptional(type) && !containsUndefined(type)) { |
| 2044 | throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.") |
| 2045 | } |
| 2046 | } |
| 2047 | } |
| 2048 | |
| 2049 | /** |
nothing calls this directly
no test coverage detected