Delete experimental Form2 that was adopted.
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 23 Feb 2020 07:31:09 +0000 (02:31 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 23 Feb 2020 07:31:09 +0000 (02:31 -0500)
src/Form.test.ts

index c61ad583fced78f6eb120a07cdb99442eeddf26c..309c302b4fb8e6378506b9c9dffc1f31205dc8af 100644 (file)
@@ -82,58 +82,3 @@ test('form types', () => {
   expect(isFormT(new FormA(), FormB)).toBe(false);
   expect(isFormT(new FormB(), FormB)).toBe(true);
 });
-
-/*
-abstract class Form2<L extends { [key: string]: Line<any> } , I> {
-  abstract readonly name: string;
-
-  protected abstract readonly _lines: L;
-  protected abstract readonly _input?: I;
-
-  getLine<K extends keyof L>(key: K): L[K] {
-    return this._lines[key];
-  }
-
-  getInput<K extends keyof I>(key: K): I[K] {
-    return this._input[key];
-  }
-
-  getValue<T, K extends keyof L>(tr: TaxReturn, key: K): T {
-    const line = this.getLine(key);
-    return line.value(tr);
-  }
-};
-
-class FormG extends Form2<FormG['_lines'], FormG['_input']> {
-  readonly name = 'G';
-
-  protected readonly _lines = {
-    x: new ComputedLine('moo', () => 42),
-    z: new ComputedLine('moo', () => 36),
-  };
-  protected readonly _input = null;
-
-  private _moo = 42;
-
-  getLineImpl<T, K extends keyof T>(lines: T, k: K): T[K] {
-    return lines[k];
-  }
-
-  allLines(): FormG['_lines'] {
-    return this._lines;
-  }
-
-  LINE = k => this.getLineImpl(this._lines, k);
-
-  testLine<K extends keyof ReturnType<FormG['allLines']>>(k: K): any {
-    return this.getLineImpl(this._lines, k);
-  }
-}
-
-test('testing', () => {
-  const g = new FormG();
-  let v = g.testLine('x'); //g.getLineImpl(g._lines, 'x');
-  let v2 = g.getValue(null, 'z');
-  throw new Error(`v = ${v2}`);
-});
-*/