From e24a73b03b074967f95b4eec883ade31f7de36b9 Mon Sep 17 00:00:00 2001 From: Paul Loyd Date: Wed, 21 Nov 2018 17:31:48 +0300 Subject: [PATCH] Add selectiveImport sample --- tests/samples/selectiveImport/modules/first.js | 15 +++++++++++++++ tests/samples/selectiveImport/schema.json | 10 ++++++++++ tests/samples/selectiveImport/source.js | 3 +++ tests/samples/selectiveImport/types.yaml | 6 ++++++ 4 files changed, 34 insertions(+) create mode 100644 tests/samples/selectiveImport/modules/first.js create mode 100644 tests/samples/selectiveImport/schema.json create mode 100644 tests/samples/selectiveImport/source.js create mode 100644 tests/samples/selectiveImport/types.yaml diff --git a/tests/samples/selectiveImport/modules/first.js b/tests/samples/selectiveImport/modules/first.js new file mode 100644 index 0000000..04ba824 --- /dev/null +++ b/tests/samples/selectiveImport/modules/first.js @@ -0,0 +1,15 @@ +export type A = { + a: number; +} + +export type IgnoredType = { + ignored: number, +}; + +export interface IgnoredInterface { + ignored: number; +} + +export default class IgnoredDefault { + ignored: number; +} diff --git a/tests/samples/selectiveImport/schema.json b/tests/samples/selectiveImport/schema.json new file mode 100644 index 0000000..316df2a --- /dev/null +++ b/tests/samples/selectiveImport/schema.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "selectiveImport::modules::first::A": { + "type": "object", + "properties": {"a": {"type": "number"}}, + "required": ["a"] + } + } +} \ No newline at end of file diff --git a/tests/samples/selectiveImport/source.js b/tests/samples/selectiveImport/source.js new file mode 100644 index 0000000..cef8e5c --- /dev/null +++ b/tests/samples/selectiveImport/source.js @@ -0,0 +1,3 @@ +import {A} from './modules/first'; + +export {A}; diff --git a/tests/samples/selectiveImport/types.yaml b/tests/samples/selectiveImport/types.yaml new file mode 100644 index 0000000..580b9fa --- /dev/null +++ b/tests/samples/selectiveImport/types.yaml @@ -0,0 +1,6 @@ +- kind: record + fields: + - name: a + value: {kind: number, repr: f64} + required: true + id: [selectiveImport, modules, first, A] \ No newline at end of file