mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
28 lines
643 B
TypeScript
28 lines
643 B
TypeScript
//// [tests/cases/conformance/types/typeRelationships/comparable/optionalProperties01.ts] ////
|
|
|
|
//// [optionalProperties01.ts]
|
|
interface Foo {
|
|
required1: string;
|
|
required2: string;
|
|
optional?: string;
|
|
}
|
|
|
|
const foo1 = { required1: "hello" } as Foo;
|
|
const foo2 = { required1: "hello", optional: "bar" } as Foo;
|
|
|
|
|
|
//// [optionalProperties01.js]
|
|
"use strict";
|
|
const foo1 = { required1: "hello" };
|
|
const foo2 = { required1: "hello", optional: "bar" };
|
|
|
|
|
|
//// [optionalProperties01.d.ts]
|
|
interface Foo {
|
|
required1: string;
|
|
required2: string;
|
|
optional?: string;
|
|
}
|
|
declare const foo1: Foo;
|
|
declare const foo2: Foo;
|