| 1396 | new ElementImpl(new AST.OptionalType(self.ast, true), self) |
| 1397 | |
| 1398 | class ElementImpl<S extends Schema.Any, Token extends Element.Token> implements Element<S, Token> { |
| 1399 | readonly [TypeId]!: Schema.Variance<Schema.Type<S>, Schema.Encoded<S>, Schema.Context<S>>[TypeId] |
| 1400 | readonly _Token!: Token |
| 1401 | constructor( |
| 1402 | readonly ast: AST.OptionalType, |
| 1403 | readonly from: S |
| 1404 | ) {} |
| 1405 | annotations( |
| 1406 | annotations: Annotations.Schema<Schema.Type<S>> |
| 1407 | ): ElementImpl<S, Token> { |
| 1408 | return new ElementImpl( |
| 1409 | new AST.OptionalType( |
| 1410 | this.ast.type, |
| 1411 | this.ast.isOptional, |
| 1412 | { ...this.ast.annotations, ...toASTAnnotations(annotations) } |
| 1413 | ), |
| 1414 | this.from |
| 1415 | ) |
| 1416 | } |
| 1417 | toString() { |
| 1418 | return `${this.ast.type}${this.ast.isOptional ? "?" : ""}` |
| 1419 | } |
| 1420 | } |
| 1421 | |
| 1422 | /** |
| 1423 | * @since 3.10.0 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…