From 1c9aeff1ce3715bc22a3b4eebb8bc5bb7109ade4 Mon Sep 17 00:00:00 2001 From: Pablo Estrada Date: Tue, 4 Jan 2022 13:21:05 -0800 Subject: [PATCH] sketching the core API for JS SDK --- sdks/node-ts/src/apache_beam/core.ts | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sdks/node-ts/src/apache_beam/core.ts diff --git a/sdks/node-ts/src/apache_beam/core.ts b/sdks/node-ts/src/apache_beam/core.ts new file mode 100644 index 0000000000000..b98c418086571 --- /dev/null +++ b/sdks/node-ts/src/apache_beam/core.ts @@ -0,0 +1,39 @@ +class PValue { + constructor() { + } + + apply(transform: PTransform): PValue { + return transform.expand(this); + } + + map(callable): PValue { + return this.apply(new ParDo(callable)); + } + +} + +class Pipeline extends PValue { + +} + +class PCollection extends PValue { + +} + +class PTransform { + expand(input: PValue): PValue { + throw new Error('Method expand has not been implemented.'); + } +} + +class ParDo extends PTransform { + private doFn; + constructor(callableOrDoFn) { + super() + this.doFn = callableOrDoFn; + } +} + +class DoFn { + +} \ No newline at end of file