This feature introduces a new kind of declaration to TypeSpec:
'extern' 'fn' Identifier '(' Parameter* ')' (':' TypeRef)? ';'
packages/http/lib/auth.tsp | |
89:model ApiKeyAuth<TLocation extends ApiKeyLocation, TName extends string> { | |
packages/http/lib/http.tsp | |
15:model Response<Status> { | |
30:model Body<T> { | |
103:model PlainData<T> { | |
packages/json-schema/lib/main.tsp | |
158:model Json<T> { |
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID8w+xPMnOAtzmVZKymO080hHnAl96rPv1TJ3z718bk1 wtemple@alto |
/** | |
* Copyright (c) Will Temple 2022 | |
* | |
* # ELEMENTAL TYPE SYSTEM | |
* | |
* This module describes an elemental type system composed of only five | |
* fundamental type forms that I find to be highly expressive in simply-typed | |
* contexts. | |
* | |
* By simply-typed, I mean systems that do not include type-binding. |
interface Foo { | |
a: string; | |
b: number; | |
bar: Bar; | |
} | |
interface Bar { | |
a: number; | |
b: string; | |
baz: Baz; |
declare class Vehicle { | |
engines: number; | |
ignition(): void; | |
drive(): void; | |
} | |
declare class Car extends Vehicle { | |
wheels: number; | |
} |
{ | |
"scripts": { | |
"rush:denial": "rushx clean && rushx build", | |
"rush:anger": "rush clean && rush rebuild", | |
"rush:bargaining": "rush clean && rush purge && rush update --full && rush rebuild", | |
"rush:depression": "while true; do rm -rf common/temp && npm run rush:bargaining; done", | |
"rush:acceptance": "cd ..; rm -rf azure-sdk-for-js; git clone https://github.com/azure/azure-sdk-for-js.git" | |
} | |
} |
mod utils; | |
use wasm_bindgen::prelude::*; | |
mod vdom; | |
use vdom::*; | |
mod dom; | |
use dom::mount; |
// This uses my modified version of typescript from my branch github.com/willmtemple/typescript#alchemy | |
import * as ts from "typescript/built/local/typescript"; | |
import * as fs from "fs"; | |
import * as os from "os"; | |
import { promisify } from "util"; | |
const readFile = promisify(fs.readFile); |
declare export function match< | |
DiscriminatedUnion extends { [K in Discriminator]: string | number }, | |
Pattern extends Partial< | |
{ | |
[K in DiscriminatedUnion[Discriminator]]: ( | |
v: Extract<DiscriminatedUnion, { kind: K }> | |
) => any; | |
} | |
>, | |
Discriminator extends string | number = "kind" |