Open junthus opened 7 years ago
이런건 어떻게 쓰지 ?
declare function trace(arg: string | number | boolean ); declare function trace(arg: { id: number; name: string });
js에서 네임 스페이스를 사용하는 경우 패스를 일치시켜야 정상적으로 사용할 수 있음
FirstNamespace.SecondNamespace.ThirdNamespace.log("test");
declare module FirstNamespace { module SecondNamespace { module ThirdNamespace { function log(msg: string); } } }
declare class MyClass {}
declare class MyClass { constructor(id: number, name: string); constructor(); }
declare class MyClass { id: number; }
declare class MyClass { hello(str?: string;): string; smile(): void; }
declare class MyClass { static id: number; static getIndices(): number[]; }
namespace 계열 키워드(namespace/module) 가 없으면 global namespace 로 간주
declare function globalLogError(msg: string);
describe("test", function (str) { console.log(str)});
declare function describe(name: string, callback: (name: string) => void);
property_name + ?
?
.d.ts advanced
이런건 어떻게 쓰지 ?
function overrides
nested namespaces
js에서 네임 스페이스를 사용하는 경우 패스를 일치시켜야 정상적으로 사용할 수 있음
classes
global namespace
namespace 계열 키워드(namespace/module) 가 없으면 global namespace 로 간주
callback (function signatures)
optional properties
property_name +
?
seemore