Skip to content

Commit

Permalink
downgrade typescript to 3.3 (microsoft/TypeScript#30663 (comment))
Browse files Browse the repository at this point in the history
  • Loading branch information
karifrederiksen committed May 3, 2019
1 parent e5a6a3b commit dc72514
Show file tree
Hide file tree
Showing 22 changed files with 88 additions and 173 deletions.
42 changes: 10 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"color": "git+https://github.com/karifrederiksen/color.git",
"css-loader": "^1.0.1",
"cssnano": "^4.1.10",
"fork-ts-checker-webpack-plugin": "^1.1.0",
"fork-ts-checker-webpack-plugin": "1.0.1",
"html-webpack-plugin": "^3.2.0",
"jest": "^24.3.1",
"jsverify": "^0.8.4",
Expand All @@ -42,10 +42,9 @@
"ts-jest": "^24.0.0",
"ts-loader": "^5.3.3",
"ts-node": "^7.0.1",
"typescript": "^3.4.4",
"typescript": "^3.3.4000",
"webpack": "^4.30.0",
"webpack-cli": "^3.3.0",
"webpack-merge": "^4.2.1",
"webpack-cli": "^3.3.1",
"webpack-serve": "^2.0.3"
}
}
3 changes: 2 additions & 1 deletion src/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import * as Canvas from "../canvas"
import * as Setup from "./setup"
import { SetOnce, FrameStream, CancelFrameStream, Lazy, Store } from "../util"
import * as Buttons from "../views/buttons"

import * as Debugging from "../debugging"
console.log(Debugging)
// HMR hooks
declare global {
interface NodeModule {
Expand Down
2 changes: 1 addition & 1 deletion src/canvas/brushShader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class Shader {
return this.offset > 0
}

addPoints(points: readonly BrushPoint[]): void {
addPoints(points: ReadonlyArray<BrushPoint>): void {
const nextOffset = 6 * floatsPerVertex * points.length + this.offset
while (nextOffset > this.array.length) {
this.array = doubleSize(this.array)
Expand Down
10 changes: 5 additions & 5 deletions src/canvas/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface RenderArgs {
}

export interface Context {
addBrushPoints(brushPoints: readonly BrushShader.BrushPoint[]): void
addBrushPoints(brushPoints: ReadonlyArray<BrushShader.BrushPoint>): void
endStroke(): void
render(args: RenderArgs): void
dispose(): void
Expand Down Expand Up @@ -216,7 +216,7 @@ class InternalContext implements Context, ContextState {
console.info("context", this)
}

addBrushPoints(brushPoints: readonly BrushShader.BrushPoint[]) {
addBrushPoints(brushPoints: ReadonlyArray<BrushShader.BrushPoint>) {
addBrushPoints(this, brushPoints)
}

Expand Down Expand Up @@ -255,7 +255,7 @@ function mergeAreas(prevArea: Vec4, nextArea: Vec4): Vec4 {

function addBrushPoints(
context: ContextState,
brushPoints: readonly BrushShader.BrushPoint[]
brushPoints: ReadonlyArray<BrushShader.BrushPoint>
): void {
context.drawpointBatch.addPoints(brushPoints)
if (context.stroke == null) {
Expand Down Expand Up @@ -511,8 +511,8 @@ function setupFb(context: ContextState, id: TextureId): WebGLFramebuffer {
}

function layersRequireRerender(
prev: readonly Layers.CollectedLayer[],
next: readonly Layers.CollectedLayer[]
prev: ReadonlyArray<Layers.CollectedLayer>,
next: ReadonlyArray<Layers.CollectedLayer>
): boolean {
if (prev.length !== next.length) return true
for (let i = 0; i < next.length; i++) {
Expand Down
8 changes: 4 additions & 4 deletions src/canvas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Vec2, Result, PerfTracker, T3 } from "../util"
export interface Hooks {
// readonly onCanvasSnapshot: (snapshot: Snapshot) => void
// readonly onLayerSnapshot: (snapshot: Snapshot, layerId: number) => void
readonly onStats: (stats: readonly PerfTracker.Sample[]) => void
readonly onStats: (stats: ReadonlyArray<PerfTracker.Sample>) => void
}

export interface State {
Expand Down Expand Up @@ -114,17 +114,17 @@ class NoOpEffect {
class FrameEffect {
readonly type: EffectType.FrameEffect = EffectType.FrameEffect
private nominal: void
constructor(readonly brushPoints: readonly BrushPoint[], readonly state: State) {}
constructor(readonly brushPoints: ReadonlyArray<BrushPoint>, readonly state: State) {}
}
class BrushPointsEffect {
readonly type: EffectType.BrushPointsEffect = EffectType.BrushPointsEffect
private nominal: void
constructor(readonly brushPoints: readonly BrushPoint[]) {}
constructor(readonly brushPoints: ReadonlyArray<BrushPoint>) {}
}
class ReleaseEffect {
readonly type: EffectType.ReleaseEffect = EffectType.ReleaseEffect
private nominal: void
constructor(readonly brushPoints: readonly BrushPoint[]) {}
constructor(readonly brushPoints: ReadonlyArray<BrushPoint>) {}
}

export interface MsgSender {
Expand Down
83 changes: 0 additions & 83 deletions src/collections/stack.test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/collections/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export namespace Stack {
return new Empty()
}

export function fromArray<a>(arr: readonly a[]): Stack<a> {
export function fromArray<a>(arr: ReadonlyArray<a>): Stack<a> {
let stack: Stack<a> = empty()
let i = arr.length
while (i--) {
Expand Down
2 changes: 1 addition & 1 deletion src/collections/zipperList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class ZipperList<a> {
return new ZipperList(Stack.empty(), value, Stack.empty())
}

static fromArray<a>(arr: readonly a[]): ZipperList<a> | null {
static fromArray<a>(arr: ReadonlyArray<a>): ZipperList<a> | null {
if (arr.length === 0) return null

let right: Stack.Stack<a> = Stack.empty()
Expand Down
18 changes: 18 additions & 0 deletions src/debugging/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as React from "react"
import styled from "../styled"

const Container = styled.div`
position: absolute;
right: 0;
bottom: 0;
`

export function DebugWindow() {
const a = 2
const b: 2 = 2
return (
<Container id="d">
Hello! {b} {a} aaa {2}
</Container>
)
}
8 changes: 4 additions & 4 deletions src/layers/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class GroupLayer {
readonly name: string,
readonly opacity: number,
readonly isHidden: boolean,
readonly children: readonly Layer[]
readonly children: ReadonlyArray<Layer>
) {}

get isLeaf(): false {
Expand All @@ -68,7 +68,7 @@ export class GroupLayer {
)
}

withChildren(children: readonly Layer[]): GroupLayer {
withChildren(children: ReadonlyArray<Layer>): GroupLayer {
return new GroupLayer(this.id, this.name, this.opacity, this.isHidden, children)
}

Expand Down Expand Up @@ -197,9 +197,9 @@ export class GroupLayer {
export type Layer = LeafLayer | GroupLayer

export interface SplitLayers {
readonly above: readonly CollectedLayer[]
readonly above: ReadonlyArray<CollectedLayer>
readonly current: CollectedLayer | null
readonly below: readonly CollectedLayer[]
readonly below: ReadonlyArray<CollectedLayer>
}

export type Msg = NewLayerMsg | RemoveMsg | SelectMsg | SetOpacityMsg | SetHiddenMsg
Expand Down
2 changes: 1 addition & 1 deletion src/rng/rng.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Rng from "./rng"

describe("rng", () => {
const seeds: readonly Rng.Seed[] = [
const seeds: ReadonlyArray<Rng.Seed> = [
Rng.seed(0),
Rng.seed(1),
Rng.seed(2),
Expand Down
6 changes: 3 additions & 3 deletions src/tools/brush.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function onDrag(
brush: State,
state: EphemeralState,
input: Input.PointerInput
): T2<EphemeralState, readonly BrushShader.BrushPoint[]> {
): T2<EphemeralState, ReadonlyArray<BrushShader.BrushPoint>> {
if (state === null) {
const res = onClick(camera, brush, input)
return [res[0], [res[1]]]
Expand All @@ -236,7 +236,7 @@ export function onFrame(
brush: State,
state: EphemeralState,
currentTime: number
): T2<EphemeralState, readonly BrushShader.BrushPoint[]> {
): T2<EphemeralState, ReadonlyArray<BrushShader.BrushPoint>> {
if (state === null) return [null, []]
// if (brush.delay.duration <= 0) return [null, []]

Expand All @@ -260,7 +260,7 @@ export function onRelease(
brush: State,
state: EphemeralState,
input: Input.PointerInput
): T2<EphemeralState, readonly BrushShader.BrushPoint[]> {
): T2<EphemeralState, ReadonlyArray<BrushShader.BrushPoint>> {
if (state === null) return [null, []]

return [null, []]
Expand Down
Loading

0 comments on commit dc72514

Please sign in to comment.