diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fdc5b2199..386986191a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - Remove handling of attributes with `bs.` prefix (`@bs.as` -> `@as` etc.). https://github.com/rescript-lang/rescript-compiler/pull/6643 - Remove obsolete `@bs.open` feature. https://github.com/rescript-lang/rescript-compiler/pull/6629 - Drop Node.js version <18 support, due to it reaching End-of-Life. https://github.com/rescript-lang/rescript-compiler/pull/6429 +- Drop `bsconfig.json` support. https://github.com/rescript-lang/rescript-compiler/pull/6781 #### :bug: Bug Fix diff --git a/bsconfig.json b/bsconfig.json deleted file mode 100644 index 7713a217f9..0000000000 --- a/bsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "bs-platform", - "version": "7.0.0", - "sources": { - "dir": "jscomp/test/" - } -} diff --git a/jscomp/bsb/bsb_build_util.ml b/jscomp/bsb/bsb_build_util.ml index 9982b5b65b..f9c8ea6cba 100644 --- a/jscomp/bsb/bsb_build_util.ml +++ b/jscomp/bsb/bsb_build_util.ml @@ -155,8 +155,8 @@ let extract_pinned_dependencies (map : Ext_json_types.t Map_string.t) : Set_stri let rec walk_all_deps_aux (visited : string Hash_string.t) (paths : string list) ~(top : top) (dir : string) (queue : _ Queue.t) ~pinned_dependencies = - match Bsb_config_load.load_json ~per_proj_dir:dir ~warn_legacy_config:false with - | _, Obj { map; loc } -> + match Bsb_config_load.load_json ~per_proj_dir:dir with + | Obj { map; loc } -> let cur_package_name = match Map_string.find_opt map Bsb_build_schemas.name with | Some (Str { str; loc }) -> diff --git a/jscomp/bsb/bsb_clean.ml b/jscomp/bsb/bsb_clean.ml index ff8ed40da1..3e1a752387 100644 --- a/jscomp/bsb/bsb_clean.ml +++ b/jscomp/bsb/bsb_clean.ml @@ -51,7 +51,7 @@ let clean_bs_garbage proj_dir = Bsb_log.warn "@{Failed@} to clean due to %s" (Printexc.to_string e) let clean_bs_deps proj_dir = - let _, _, _, pinned_dependencies = Bsb_config_parse.deps_from_bsconfig () in + let _, _, _, pinned_dependencies = Bsb_config_parse.deps_from_config () in let queue = Bsb_build_util.walk_all_deps proj_dir ~pinned_dependencies in Queue.iter (fun (pkg_cxt : Bsb_build_util.package_context) -> diff --git a/jscomp/bsb/bsb_config_load.ml b/jscomp/bsb/bsb_config_load.ml index 0255663763..5e432df429 100644 --- a/jscomp/bsb/bsb_config_load.ml +++ b/jscomp/bsb/bsb_config_load.ml @@ -1,24 +1,5 @@ let ( // ) = Ext_path.combine -let load_json ~(per_proj_dir : string) ~(warn_legacy_config : bool) - : string * Ext_json_types.t = - let filename, abs, in_chan = - let filename = Literals.rescript_json in - let abs = (per_proj_dir // filename) in - match open_in abs - with - | in_chan -> (filename, abs, in_chan) - | exception e -> - let filename = Literals.bsconfig_json in - let abs = (per_proj_dir // filename) in - match open_in abs - with - | in_chan -> (filename, abs, in_chan) - | exception _ -> raise e (* forward error from rescript.json *) - in - if warn_legacy_config && filename = Literals.bsconfig_json then - print_endline "Warning: bsconfig.json is deprecated. Migrate it to rescript.json\n"; - match Ext_json_parse.parse_json_from_chan abs in_chan - with - | v -> close_in in_chan ; (filename, v) - | exception e -> close_in in_chan ; raise e +let load_json ~(per_proj_dir : string) + : Ext_json_types.t = + Ext_json_parse.parse_json_from_file (per_proj_dir // Literals.rescript_json) diff --git a/jscomp/bsb/bsb_config_load.mli b/jscomp/bsb/bsb_config_load.mli index 7e8cd97857..fe24b51a9d 100644 --- a/jscomp/bsb/bsb_config_load.mli +++ b/jscomp/bsb/bsb_config_load.mli @@ -1,2 +1,2 @@ val load_json : - per_proj_dir:string -> warn_legacy_config:bool -> string * Ext_json_types.t + per_proj_dir:string -> Ext_json_types.t diff --git a/jscomp/bsb/bsb_config_parse.ml b/jscomp/bsb/bsb_config_parse.ml index 4a9aab131c..c8e6f358a7 100644 --- a/jscomp/bsb/bsb_config_parse.ml +++ b/jscomp/bsb/bsb_config_parse.ml @@ -348,13 +348,13 @@ let interpret_json Bsb_exception.invalid_spec ("no sources specified in " ^ filename)) | _ -> Bsb_exception.invalid_spec (filename ^ " expect a json object {}") -let deps_from_bsconfig () = +let deps_from_config () = let cwd = Bsb_global_paths.cwd in - match Bsb_config_load.load_json ~per_proj_dir:cwd ~warn_legacy_config:false + match Bsb_config_load.load_json ~per_proj_dir:cwd with - | _, Obj { map } -> + | Obj { map } -> ( Bsb_package_specs.from_map ~cwd map, Bsb_jsx.from_map map, extract_uncurried map, Bsb_build_util.extract_pinned_dependencies map ) - | _, _ -> assert false + | _ -> assert false diff --git a/jscomp/bsb/bsb_config_parse.mli b/jscomp/bsb/bsb_config_parse.mli index 3aedf9891b..edf68ce23d 100644 --- a/jscomp/bsb/bsb_config_parse.mli +++ b/jscomp/bsb/bsb_config_parse.mli @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -val deps_from_bsconfig : unit -> Bsb_package_specs.t * Bsb_jsx.t * bool * Set_string.t +val deps_from_config : unit -> Bsb_package_specs.t * Bsb_jsx.t * bool * Set_string.t val interpret_json : filename:string -> diff --git a/jscomp/bsb/bsb_ninja_regen.ml b/jscomp/bsb/bsb_ninja_regen.ml index d2953b93ee..37c6455d6a 100644 --- a/jscomp/bsb/bsb_ninja_regen.ml +++ b/jscomp/bsb/bsb_ninja_regen.ml @@ -30,7 +30,7 @@ let ( // ) = Ext_path.combine return None if we dont need regenerate otherwise return Some info *) -let regenerate_ninja ~(package_kind : Bsb_package_kind.t) ~forced ~per_proj_dir ~warn_legacy_config ~warn_as_error +let regenerate_ninja ~(package_kind : Bsb_package_kind.t) ~forced ~per_proj_dir ~warn_as_error : Bsb_config_types.t option = let lib_artifacts_dir = Bsb_config.lib_bs in let lib_bs_dir = per_proj_dir // lib_artifacts_dir in @@ -38,9 +38,7 @@ let regenerate_ninja ~(package_kind : Bsb_package_kind.t) ~forced ~per_proj_dir let check_result = Bsb_ninja_check.check ~package_kind ~per_proj_dir ~forced ~file:output_deps in - let config_filename, config_json = - Bsb_config_load.load_json ~per_proj_dir ~warn_legacy_config - in + let config_json = Bsb_config_load.load_json ~per_proj_dir in match check_result with | Good -> None (* Fast path, no need regenerate ninja *) | Bsb_forced | Bsb_bsc_version_mismatch | Bsb_package_kind_inconsistent @@ -56,7 +54,7 @@ let regenerate_ninja ~(package_kind : Bsb_package_kind.t) ~forced ~per_proj_dir let config : Bsb_config_types.t = Bsb_config_parse.interpret_json - ~filename:config_filename ~json:config_json ~package_kind ~per_proj_dir + ~filename:Literals.rescript_json ~json:config_json ~package_kind ~per_proj_dir in let warning = match config.warning with diff --git a/jscomp/bsb/bsb_ninja_regen.mli b/jscomp/bsb/bsb_ninja_regen.mli index 0af5766e57..34b9cd50aa 100644 --- a/jscomp/bsb/bsb_ninja_regen.mli +++ b/jscomp/bsb/bsb_ninja_regen.mli @@ -26,7 +26,6 @@ val regenerate_ninja : package_kind:Bsb_package_kind.t -> forced:bool -> per_proj_dir:string -> - warn_legacy_config:bool -> warn_as_error:string option -> Bsb_config_types.t option (** Regenerate ninja file by need based on [.bsdeps] diff --git a/jscomp/bsb/bsb_parse_sources.ml b/jscomp/bsb/bsb_parse_sources.ml index e9969e957d..67c7f7956d 100644 --- a/jscomp/bsb/bsb_parse_sources.ml +++ b/jscomp/bsb/bsb_parse_sources.ml @@ -410,7 +410,7 @@ and walk_source_dir_map (cxt : walk_cxt) sub_dirs_field = let clean_re_js root = match Ext_json_parse.parse_json_from_file - (Filename.concat root Literals.bsconfig_json) + (Filename.concat root Literals.rescript_json) with | Obj { map } -> let ignored_dirs = diff --git a/jscomp/bsb/bsb_world.ml b/jscomp/bsb/bsb_world.ml index 30b776c796..700b2c53c8 100644 --- a/jscomp/bsb/bsb_world.ml +++ b/jscomp/bsb/bsb_world.ml @@ -34,7 +34,7 @@ let make_world_deps cwd (config : Bsb_config_types.t option) we will read such json file to know which [package-specs] it wants *) - Bsb_config_parse.deps_from_bsconfig () + Bsb_config_parse.deps_from_config () | Some config -> (config.package_specs, config.jsx, config.uncurried, config.pinned_dependencies) in @@ -70,7 +70,6 @@ let make_world_deps cwd (config : Bsb_config_types.t option) (if is_pinned then Pinned_dependency { package_specs; jsx; uncurried } else Dependency { package_specs; jsx; uncurried }) ~per_proj_dir:proj_dir ~forced:false - ~warn_legacy_config:false ~warn_as_error:(if is_pinned then warn_as_error else None) in let command = diff --git a/jscomp/bsb_exe/rescript_main.ml b/jscomp/bsb_exe/rescript_main.ml index 3e29b33c6e..ecf789e348 100644 --- a/jscomp/bsb_exe/rescript_main.ml +++ b/jscomp/bsb_exe/rescript_main.ml @@ -156,7 +156,6 @@ let build_subcommand ~start argv argv_len = ~package_kind:Toplevel ~per_proj_dir:Bsb_global_paths.cwd ~forced:!force_regenerate - ~warn_legacy_config:true ~warn_as_error in if not !no_deps_mode then Bsb_world.make_world_deps Bsb_global_paths.cwd config_opt ninja_args warn_as_error; @@ -190,7 +189,6 @@ let info_subcommand ~start argv = ~package_kind:Toplevel ~per_proj_dir:Bsb_global_paths.cwd ~forced:true - ~warn_legacy_config:true ~warn_as_error:None with | None -> assert false @@ -221,7 +219,6 @@ let () = ~package_kind:Toplevel ~per_proj_dir:Bsb_global_paths.cwd ~forced:false - ~warn_legacy_config:true ~warn_as_error:None in Bsb_world.make_world_deps Bsb_global_paths.cwd config_opt [||] None; diff --git a/jscomp/build_tests/warn_legacy_config/bsconfig.json b/jscomp/build_tests/warn_legacy_config/bsconfig.json deleted file mode 100644 index ff8aa6b4b0..0000000000 --- a/jscomp/build_tests/warn_legacy_config/bsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "warn_legacy_config", - "version": "0.1.0", - "sources": { - "dir": "src", - "subdirs": true - } -} diff --git a/jscomp/build_tests/warn_legacy_config/input.js b/jscomp/build_tests/warn_legacy_config/input.js deleted file mode 100644 index ad81e9ec49..0000000000 --- a/jscomp/build_tests/warn_legacy_config/input.js +++ /dev/null @@ -1,10 +0,0 @@ -const { spawnSync } = require("child_process"); -const assert = require("assert"); -const rescript_exe = require("../../../scripts/bin_path").rescript_exe; - -const output = spawnSync(rescript_exe, { encoding: "utf8" }); -assert( - /^Warning: bsconfig.json is deprecated. Migrate it to rescript.json/.test( - output.stdout - ) -); diff --git a/jscomp/build_tests/warn_legacy_config/src/demo.res b/jscomp/build_tests/warn_legacy_config/src/demo.res deleted file mode 100644 index 8d0b19151f..0000000000 --- a/jscomp/build_tests/warn_legacy_config/src/demo.res +++ /dev/null @@ -1 +0,0 @@ -let () = Js.log("Hello, ReScript") diff --git a/jscomp/ext/ext_path.ml b/jscomp/ext/ext_path.ml index 31bbe47a67..835d491cd2 100644 --- a/jscomp/ext/ext_path.ml +++ b/jscomp/ext/ext_path.ml @@ -272,6 +272,6 @@ let rec find_root_filename ~cwd filenames = find_root_filename ~cwd:cwd' filenames else Ext_fmt.failwithf ~loc:__LOC__ "%s not found from %s" (List.hd filenames) cwd -let find_config_dir cwd = find_root_filename ~cwd [Literals.rescript_json; Literals.bsconfig_json] +let find_config_dir cwd = find_root_filename ~cwd [Literals.rescript_json] let package_dir = lazy (find_config_dir (Lazy.force cwd)) diff --git a/jscomp/ext/literals.ml b/jscomp/ext/literals.ml index b1aa1c2bc5..48a522975e 100644 --- a/jscomp/ext/literals.ml +++ b/jscomp/ext/literals.ml @@ -74,8 +74,6 @@ let node_modules_length = String.length "node_modules" let package_json = "package.json" -let bsconfig_json = "bsconfig.json" - let rescript_json = "rescript.json" let build_ninja = "build.ninja" diff --git a/jscomp/gentype/GenTypeConfig.ml b/jscomp/gentype/GenTypeConfig.ml index 9e5ec193c8..7e84e9bb16 100644 --- a/jscomp/gentype/GenTypeConfig.ml +++ b/jscomp/gentype/GenTypeConfig.ml @@ -102,13 +102,9 @@ let setDebug ~gtconf = | _ -> () let compilerConfigFile = "rescript.json" -let legacyCompilerConfigFile = "bsconfig.json" let rec findProjectRoot ~dir = - if - Sys.file_exists (Filename.concat dir compilerConfigFile) - || Sys.file_exists (Filename.concat dir legacyCompilerConfigFile) - then dir + if Sys.file_exists (Filename.concat dir compilerConfigFile) then dir else let parent = dir |> Filename.dirname in if parent = dir then ( diff --git a/jscomp/gentype/Paths.ml b/jscomp/gentype/Paths.ml index ed95905268..71278fcbff 100644 --- a/jscomp/gentype/Paths.ml +++ b/jscomp/gentype/Paths.ml @@ -65,10 +65,6 @@ let getConfigFile ~projectRoot = let config = concat projectRoot Config.compilerConfigFile in match config |> Sys.file_exists with | true -> Some config - | false -> ( - let config = concat projectRoot Config.legacyCompilerConfigFile in - match config |> Sys.file_exists with - | true -> Some config - | false -> None) + | false -> None let readConfig ~namespace = Config.readConfig ~getConfigFile ~namespace diff --git a/jscomp/gentype_tests/typescript-react-example/package-lock.json b/jscomp/gentype_tests/typescript-react-example/package-lock.json index 5fdd739d29..f98e37ff32 100644 --- a/jscomp/gentype_tests/typescript-react-example/package-lock.json +++ b/jscomp/gentype_tests/typescript-react-example/package-lock.json @@ -24,14 +24,15 @@ }, "../../..": { "name": "rescript", - "version": "11.1.0", + "version": "12.0.0-alpha.1", "dev": true, "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "bin": { "bsc": "bsc", "bstracing": "lib/bstracing", - "rescript": "rescript" + "rescript": "rescript", + "rewatch": "scripts/rewatch" }, "devDependencies": { "mocha": "10.1.0", @@ -39,7 +40,7 @@ "prettier": "2.7.1" }, "engines": { - "node": ">=10" + "node": ">=18" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/jscomp/gentype_tests/typescript-react-example/src/AutoAnnotate.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/AutoAnnotate.gen.tsx deleted file mode 100644 index 55660702c9..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/AutoAnnotate.gen.tsx +++ /dev/null @@ -1,18 +0,0 @@ -/* TypeScript file generated from AutoAnnotate.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type variant = { TAG: "R"; _0: number }; - -export type record = { readonly variant: variant }; - -export type r2 = { readonly r2: number }; - -export type r3 = { readonly r3: number }; - -export type r4 = { readonly r4: number }; - -export type annotatedVariant = - { TAG: "R2"; _0: r2; _1: r3 } - | { TAG: "R4"; _0: r4 }; diff --git a/jscomp/gentype_tests/typescript-react-example/src/AutoAnnotate.res.js b/jscomp/gentype_tests/typescript-react-example/src/AutoAnnotate.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/AutoAnnotate.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/BigInt.res.js b/jscomp/gentype_tests/typescript-react-example/src/BigInt.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/BigInt.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/BootloaderResource.res.js b/jscomp/gentype_tests/typescript-react-example/src/BootloaderResource.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/BootloaderResource.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/BucklescriptAnnotations.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/BucklescriptAnnotations.gen.tsx deleted file mode 100644 index 3a734499c9..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/BucklescriptAnnotations.gen.tsx +++ /dev/null @@ -1,18 +0,0 @@ -/* TypeScript file generated from BucklescriptAnnotations.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type someMutableFields = { - mutable0: string; - readonly immutable: number; - mutable1: string; - mutable2: string -}; - -export type someMethods = { - readonly send: (_1:string) => void; - readonly on: (_1:string, _2:((_1:number) => void)) => void; - readonly threeargs: (_1:number, _2:string, _3:number) => string; - readonly twoArgs: (_1:number, _2:string) => number -}; diff --git a/jscomp/gentype_tests/typescript-react-example/src/BucklescriptAnnotations.res.js b/jscomp/gentype_tests/typescript-react-example/src/BucklescriptAnnotations.res.js deleted file mode 100644 index 7f66df862d..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/BucklescriptAnnotations.res.js +++ /dev/null @@ -1,12 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function bar(x) { - var f = x.twoArgs; - return f(3, "a"); -} - -export { - bar , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Comments.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Comments.gen.tsx deleted file mode 100644 index 584da010cf..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Comments.gen.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* TypeScript file generated from Comments.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as CommentsJS from './Comments.res.js'; - -export type DecideSubject_payload = { -/** A hint to use as a guide when thinking of your poem. */ -readonly hint: string }; - -/** The input used to generate the prompt and system prompt. */ -export abstract class DecideSubject_input { protected opaque!: any }; /* simulate opaque types */ - -/** The output from evaluating the llm prompt */ -export type DecideSubject_output = { - /** The text of the poem. */ - readonly text: string; - /** The prompt used to generate the poem. */ - readonly prompt: string; - /** The system prompt used to generate the poem. */ - readonly systemPrompt: string -}; - -/** Decide on a subject matter for a poem. */ -export const DecideSubject__placeholder: (run:string, times:number) => void = CommentsJS.DecideSubject._placeholder as any; - -export const DecideSubject: { -/** Decide on a subject matter for a poem. */ -_placeholder: (run:string, times:number) => void } = CommentsJS.DecideSubject as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Comments.res.js b/jscomp/gentype_tests/typescript-react-example/src/Comments.res.js deleted file mode 100644 index 2575585401..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Comments.res.js +++ /dev/null @@ -1,15 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function _placeholder(run, times) { - -} - -var DecideSubject = { - _placeholder: _placeholder -}; - -export { - DecideSubject , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Core.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Core.gen.tsx deleted file mode 100644 index 08e72401d0..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Core.gen.tsx +++ /dev/null @@ -1,72 +0,0 @@ -/* TypeScript file generated from Core.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import {someFunWithNullThenOptionalArgs as someFunWithNullThenOptionalArgsNotChecked} from './CoreTS'; - -import {someFunWithNullUndefinedArg as someFunWithNullUndefinedArgNotChecked} from './CoreTS'; - -// In case of type error, check the type of 'someFunWithNullThenOptionalArgs' in 'Core.res' and './CoreTS'. -export const someFunWithNullThenOptionalArgsTypeChecked: (_1:(null | string), _2:(undefined | string)) => string = someFunWithNullThenOptionalArgsNotChecked as any; - -// Export 'someFunWithNullThenOptionalArgs' early to allow circular import from the '.bs.js' file. -export const someFunWithNullThenOptionalArgs: unknown = someFunWithNullThenOptionalArgsTypeChecked as (_1:(null | string), _2:(undefined | string)) => string as any; - -// In case of type error, check the type of 'someFunWithNullUndefinedArg' in 'Core.res' and './CoreTS'. -export const someFunWithNullUndefinedArgTypeChecked: (_1:(null | undefined | string), _2:number) => string = someFunWithNullUndefinedArgNotChecked as any; - -// Export 'someFunWithNullUndefinedArg' early to allow circular import from the '.bs.js' file. -export const someFunWithNullUndefinedArg: unknown = someFunWithNullUndefinedArgTypeChecked as (_1:(null | undefined | string), _2:number) => string as any; - -const CoreJS = require('./Core.res.js'); - -export type variant = "A" | { TAG: "B"; _0: string }; - -export type t1 = { readonly x?: string }; - -export type t2 = { readonly x: (undefined | string) }; - -export const null0: (x:(null | number)) => (null | number) = CoreJS.null0 as any; - -export const null1: (x:(null | number)) => (null | number) = CoreJS.null1 as any; - -export const nullable0: (x:(null | undefined | number)) => (null | undefined | number) = CoreJS.nullable0 as any; - -export const nullable1: (x:(null | undefined | number)) => (null | undefined | number) = CoreJS.nullable1 as any; - -export const undefined0: (x:(undefined | number)) => (undefined | number) = CoreJS.undefined0 as any; - -export const undefined1: (x:(undefined | number)) => (undefined | number) = CoreJS.undefined1 as any; - -export const dict0: (x:{[id: string]: string}) => {[id: string]: string} = CoreJS.dict0 as any; - -export const dict1: (x:{[id: string]: string}) => {[id: string]: string} = CoreJS.dict1 as any; - -export const promise0: (x:Promise) => Promise = CoreJS.promise0 as any; - -export const promise1: (x:Promise) => Promise = CoreJS.promise1 as any; - -export const date0: (x:Date) => Date = CoreJS.date0 as any; - -export const date1: (x:Date) => Date = CoreJS.date1 as any; - -export const bigint0: (x:BigInt) => BigInt = CoreJS.bigint0 as any; - -export const bigint1: (x:BigInt) => BigInt = CoreJS.bigint1 as any; - -export const regexp0: (x:RegExp) => RegExp = CoreJS.regexp0 as any; - -export const regexp1: (x:RegExp) => RegExp = CoreJS.regexp1 as any; - -export const map1: (x:Map) => Map = CoreJS.map1 as any; - -export const weakmap1: (x:WeakMap) => WeakMap = CoreJS.weakmap1 as any; - -export const set1: (x:Set) => Set = CoreJS.set1 as any; - -export const weakset1: (x:WeakSet) => WeakSet = CoreJS.weakset1 as any; - -export const option0: (x:(undefined | string)) => (undefined | string) = CoreJS.option0 as any; - -export const option1: (x:(undefined | variant)) => (undefined | variant) = CoreJS.option1 as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Core.res.js b/jscomp/gentype_tests/typescript-react-example/src/Core.res.js deleted file mode 100644 index 0864298fc2..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Core.res.js +++ /dev/null @@ -1,133 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as CoreGen from "./Core.gen"; - -function null0(x) { - return x; -} - -function null1(x) { - return x; -} - -function nullable0(x) { - return x; -} - -function nullable1(x) { - return x; -} - -function undefined0(x) { - return x; -} - -function undefined1(x) { - return x; -} - -function dict0(x) { - return x; -} - -function dict1(x) { - return x; -} - -function promise0(x) { - return x; -} - -function promise1(x) { - return x; -} - -function date0(x) { - return x; -} - -function date1(x) { - return x; -} - -function bigint0(x) { - return x; -} - -function bigint1(x) { - return x; -} - -function regexp0(x) { - return x; -} - -function regexp1(x) { - return x; -} - -function map1(x) { - return x; -} - -function weakmap1(x) { - return x; -} - -function set1(x) { - return x; -} - -function weakset1(x) { - return x; -} - -function option0(x) { - return x; -} - -function option1(x) { - return x; -} - -function someFunWithNullThenOptionalArgs(prim0, prim1) { - return CoreGen.someFunWithNullThenOptionalArgs(prim0, prim1); -} - -function someFunWithNullUndefinedArg(prim0, prim1) { - return CoreGen.someFunWithNullUndefinedArg(prim0, prim1); -} - -var $$Map; - -var $$Set; - -export { - null0 , - null1 , - nullable0 , - nullable1 , - undefined0 , - undefined1 , - dict0 , - dict1 , - promise0 , - promise1 , - date0 , - date1 , - bigint0 , - bigint1 , - regexp0 , - regexp1 , - $$Map , - $$Set , - map1 , - weakmap1 , - set1 , - weakset1 , - option0 , - option1 , - someFunWithNullThenOptionalArgs , - someFunWithNullUndefinedArg , -} -/* ./Core.gen Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/CreateErrorHandler1.res.js b/jscomp/gentype_tests/typescript-react-example/src/CreateErrorHandler1.res.js deleted file mode 100644 index 858279113e..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/CreateErrorHandler1.res.js +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Curry from "rescript/lib/es6/curry.js"; -import * as ErrorHandler from "./ErrorHandler.res.js"; - -function notification(s) { - return [ - s, - s - ]; -} - -var Error1 = { - notification: notification -}; - -var MyErrorHandler = ErrorHandler.Make(Error1); - -Curry._1(MyErrorHandler.notify, "abc"); - -export { - Error1 , - MyErrorHandler , -} -/* MyErrorHandler Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/CreateErrorHandler2.res.js b/jscomp/gentype_tests/typescript-react-example/src/CreateErrorHandler2.res.js deleted file mode 100644 index ef8547fe5f..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/CreateErrorHandler2.res.js +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as ErrorHandler from "./ErrorHandler.res.js"; - -function notification(n) { - return [ - String(n), - "" - ]; -} - -var Error2 = { - notification: notification -}; - -var MyErrorHandler = ErrorHandler.Make(Error2); - -export { - Error2 , - MyErrorHandler , -} -/* MyErrorHandler Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Date.res.js b/jscomp/gentype_tests/typescript-react-example/src/Date.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Date.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Derivings.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Derivings.gen.tsx deleted file mode 100644 index 5a23227fc9..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Derivings.gen.tsx +++ /dev/null @@ -1,17 +0,0 @@ -/* TypeScript file generated from Derivings.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as DerivingsJS from './Derivings.res.js'; - -export type action = - "Click" - | "Cancel" - | { TAG: "Submit"; _0: string }; - -export const click: action = DerivingsJS.click as any; - -export const submit: (_1:string) => action = DerivingsJS.submit as any; - -export const cancel: action = DerivingsJS.cancel as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Derivings.res.js b/jscomp/gentype_tests/typescript-react-example/src/Derivings.res.js deleted file mode 100644 index 5165501116..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Derivings.res.js +++ /dev/null @@ -1,20 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function submit(param_0) { - return { - TAG: "Submit", - _0: param_0 - }; -} - -var click = "Click"; - -var cancel = "Cancel"; - -export { - click , - submit , - cancel , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Dict.res.js b/jscomp/gentype_tests/typescript-react-example/src/Dict.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Dict.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Docstrings.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Docstrings.gen.tsx deleted file mode 100644 index d6bbe2074e..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Docstrings.gen.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/* TypeScript file generated from Docstrings.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as DocstringsJS from './Docstrings.res.js'; - -export type t = "A" | "B"; - -/** hello */ -export const flat: number = DocstringsJS.flat as any; - -/** \n * Sign a message with a key.\n *\n * @param message - A message to be signed\n * @param key - The key with which to sign the message\n * @returns A signed message\n */ -export const signMessage: (message:string, key:number) => string = DocstringsJS.signMessage as any; - -export const one: (a:number) => number = DocstringsJS.one as any; - -export const two: (a:number, b:number) => number = DocstringsJS.two as any; - -export const tree: (a:number, b:number, c:number) => number = DocstringsJS.tree as any; - -export const oneU: (a:number) => number = DocstringsJS.oneU as any; - -export const twoU: (a:number, b:number) => number = DocstringsJS.twoU as any; - -export const treeU: (a:number, b:number, c:number) => number = DocstringsJS.treeU as any; - -export const useParam: (param:number) => number = DocstringsJS.useParam as any; - -export const useParamU: (param:number) => number = DocstringsJS.useParamU as any; - -export const unnamed1: (param:number) => number = DocstringsJS.unnamed1 as any; - -export const unnamed1U: (param:number) => number = DocstringsJS.unnamed1U as any; - -export const unnamed2: (param_0:number, param_1:number) => number = DocstringsJS.unnamed2 as any; - -export const unnamed2U: (param_0:number, param_1:number) => number = DocstringsJS.unnamed2U as any; - -export const grouped: (x:number, y:number, a:number, b:number, c:number, z:number) => number = DocstringsJS.grouped as any; - -export const unitArgWithoutConversion: () => string = DocstringsJS.unitArgWithoutConversion as any; - -export const unitArgWithoutConversionU: () => string = DocstringsJS.unitArgWithoutConversionU as any; - -export const unitArgWithConversion: () => t = DocstringsJS.unitArgWithConversion as any; - -export const unitArgWithConversionU: () => t = DocstringsJS.unitArgWithConversionU as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Docstrings.res.js b/jscomp/gentype_tests/typescript-react-example/src/Docstrings.res.js deleted file mode 100644 index 2ab5a33b9d..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Docstrings.res.js +++ /dev/null @@ -1,99 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function signMessage(message, key) { - return message + String(key); -} - -function one(a) { - return a + 0 | 0; -} - -function two(a, b) { - return (a + b | 0) + 0 | 0; -} - -function tree(a, b, c) { - return ((a + b | 0) + c | 0) + 0 | 0; -} - -function oneU(a) { - return a + 0 | 0; -} - -function twoU(a, b) { - return (a + b | 0) + 0 | 0; -} - -function treeU(a, b, c) { - return ((a + b | 0) + c | 0) + 0 | 0; -} - -function useParam(param) { - return param + 34 | 0; -} - -function useParamU(param) { - return param + 34 | 0; -} - -function unnamed1(param) { - return 34; -} - -function unnamed1U(param) { - return 34; -} - -function unnamed2(param, param$1) { - return 34; -} - -function unnamed2U(param, param$1) { - return 34; -} - -function grouped(x, y, a, b, c, z) { - return ((((x + y | 0) + a | 0) + b | 0) + c | 0) + z | 0; -} - -function unitArgWithoutConversion(param) { - return "abc"; -} - -function unitArgWithoutConversionU() { - return "abc"; -} - -function unitArgWithConversion(param) { - return "A"; -} - -function unitArgWithConversionU() { - return "A"; -} - -var flat = 34; - -export { - flat , - signMessage , - one , - two , - tree , - oneU , - twoU , - treeU , - useParam , - useParamU , - unnamed1 , - unnamed1U , - unnamed2 , - unnamed2U , - grouped , - unitArgWithoutConversion , - unitArgWithoutConversionU , - unitArgWithConversion , - unitArgWithConversionU , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/DynamicallyLoadedComponent.res.js b/jscomp/gentype_tests/typescript-react-example/src/DynamicallyLoadedComponent.res.js deleted file mode 100644 index 9eb45eebb7..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/DynamicallyLoadedComponent.res.js +++ /dev/null @@ -1,13 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function DynamicallyLoadedComponent(Props) { - return Props.s; -} - -var make = DynamicallyLoadedComponent; - -export { - make , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.gen.tsx deleted file mode 100644 index 0bfa420df3..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.gen.tsx +++ /dev/null @@ -1,18 +0,0 @@ -/* TypeScript file generated from EmitModuleIfNoConversion.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as EmitModuleIfNoConversionJS from './EmitModuleIfNoConversion.res.js'; - -export type t = "A" | { TAG: "B"; readonly name: string }; - -export const X_foo: (t:t) => void = EmitModuleIfNoConversionJS.X.foo as any; - -export const X_x: number = EmitModuleIfNoConversionJS.X.x as any; - -export const Y_x: string = EmitModuleIfNoConversionJS.Y.x as any; - -export const Y: { x: string } = EmitModuleIfNoConversionJS.Y as any; - -export const X: { x: number; foo: (t:t) => void } = EmitModuleIfNoConversionJS.X as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.res.js b/jscomp/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.res.js deleted file mode 100644 index f73e0e7ede..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.res.js +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function foo(t) { - if (typeof t !== "object") { - console.log("A"); - return ; - } - console.log("B" + t.name); -} - -var X = { - foo: foo, - x: 42 -}; - -var Y = { - x: "" -}; - -export { - X , - Y , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js b/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js deleted file mode 100644 index 27dcce45a2..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js +++ /dev/null @@ -1,20 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Curry from "rescript/lib/es6/curry.js"; - -function Make($$Error) { - var notify = function (x) { - return Curry._1($$Error.notification, x); - }; - return { - notify: notify - }; -} - -var x = 42; - -export { - Make , - x , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ExportWithRename.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/ExportWithRename.gen.tsx deleted file mode 100644 index 78737da02d..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ExportWithRename.gen.tsx +++ /dev/null @@ -1,12 +0,0 @@ -/* TypeScript file generated from ExportWithRename.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as React from 'react'; - -import * as ExportWithRenameJS from './ExportWithRename.res.js'; - -export type Props = { readonly s: string }; - -export const Renamed: React.ComponentType<{ readonly s: string }> = ExportWithRenameJS.make as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/ExportWithRename.res.js b/jscomp/gentype_tests/typescript-react-example/src/ExportWithRename.res.js deleted file mode 100644 index 41537fe199..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ExportWithRename.res.js +++ /dev/null @@ -1,13 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function ExportWithRename(Props) { - return Props.s; -} - -var make = ExportWithRename; - -export { - make , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/FirstClassModules.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/FirstClassModules.gen.tsx deleted file mode 100644 index 3b0d202e02..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/FirstClassModules.gen.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* TypeScript file generated from FirstClassModules.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as FirstClassModulesJS from './FirstClassModules.res.js'; - -export type MT_t = number; - -export type MT_InnerModule3_inner = number; - -export type firstClassModule = { - readonly x: number; - readonly EmptyInnerModule: { - }; - readonly InnerModule2: { - readonly k: MT_t - }; - readonly InnerModule3: { - readonly k3: (_1:MT_InnerModule3_inner) => MT_InnerModule3_inner - }; - readonly Z: unknown; - readonly y: string -}; - -export const firstClassModule: firstClassModule = FirstClassModulesJS.firstClassModule as any; - -export const testConvert: (m:{ - readonly x: number; - readonly EmptyInnerModule: { - }; - readonly InnerModule2: { - readonly k: MT_t - }; - readonly InnerModule3: { - readonly k3: ((_1:MT_InnerModule3_inner) => MT_InnerModule3_inner) - }; - readonly Z: unknown; - readonly y: string -}) => { - readonly x: number; - readonly EmptyInnerModule: { - }; - readonly InnerModule2: { - readonly k: MT_t - }; - readonly InnerModule3: { - readonly k3: (_1:MT_InnerModule3_inner) => MT_InnerModule3_inner - }; - readonly Z: unknown; - readonly y: string -} = FirstClassModulesJS.testConvert as any; - -export const someFunctorAsFunction: (x:{ - readonly x: number; - readonly EmptyInnerModule: { - }; - readonly InnerModule2: { - readonly k: MT_t - }; - readonly InnerModule3: { - readonly k3: ((_1:MT_InnerModule3_inner) => MT_InnerModule3_inner) - }; - readonly Z: unknown; - readonly y: string -}) => { readonly ww: string } = FirstClassModulesJS.someFunctorAsFunction as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/FirstClassModules.res.js b/jscomp/gentype_tests/typescript-react-example/src/FirstClassModules.res.js deleted file mode 100644 index f5e1e861fb..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/FirstClassModules.res.js +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var y = "abc"; - -var EmptyInnerModule = {}; - -var InnerModule2 = { - k: 4242 -}; - -function k3(x) { - return x + 1 | 0; -} - -var InnerModule3 = { - k3: k3 -}; - -var Z = { - u: [ - 0, - 0 - ] -}; - -var M = { - y: y, - EmptyInnerModule: EmptyInnerModule, - InnerModule2: InnerModule2, - InnerModule3: InnerModule3, - Z: Z, - x: 42 -}; - -var firstClassModule = { - x: 42, - EmptyInnerModule: EmptyInnerModule, - InnerModule2: InnerModule2, - InnerModule3: InnerModule3, - Z: Z, - y: y -}; - -function testConvert(m) { - return m; -} - -function SomeFunctor(X) { - return { - ww: X.y - }; -} - -function someFunctorAsFunction(x) { - return { - ww: x.y - }; -} - -export { - M , - firstClassModule , - testConvert , - SomeFunctor , - someFunctorAsFunction , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/FirstClassModulesInterface.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/FirstClassModulesInterface.gen.tsx deleted file mode 100644 index 6da111a8aa..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/FirstClassModulesInterface.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from FirstClassModulesInterface.resi by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type record = { readonly x: number; readonly y: string }; - -export type firstClassModule = { readonly x: number }; diff --git a/jscomp/gentype_tests/typescript-react-example/src/FirstClassModulesInterface.res.js b/jscomp/gentype_tests/typescript-react-example/src/FirstClassModulesInterface.res.js deleted file mode 100644 index 6d7febd4ad..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/FirstClassModulesInterface.res.js +++ /dev/null @@ -1,12 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var r = { - x: 3, - y: "hello" -}; - -export { - r , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/GADT.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/GADT.gen.tsx deleted file mode 100644 index b6e29a5c55..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/GADT.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from GADT.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export abstract class t { protected opaque!: any }; /* simulate opaque types */ - -export abstract class tt { protected opaque!: any }; /* simulate opaque types */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/GADT.res.js b/jscomp/gentype_tests/typescript-react-example/src/GADT.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/GADT.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Hooks.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Hooks.gen.tsx deleted file mode 100644 index 39f83f9fdc..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Hooks.gen.tsx +++ /dev/null @@ -1,145 +0,0 @@ -/* TypeScript file generated from Hooks.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as React from 'react'; - -import * as HooksJS from './Hooks.res.js'; - -import type {TypedArray2_Uint8Array_t as Js_TypedArray2_Uint8Array_t} from '../src/shims/Js.shim'; - -export type vehicle = { readonly name: string }; - -export type cb = (_to:vehicle) => void; - -export type r = { readonly x: string }; - -export type callback = (_1:input) => output; - -export type testReactContext = React.Context; - -export type testReactRef = { current: (null | number) }; - -export type testDomRef = React.Ref; - -export type testDomRef2 = React.Ref; - -export type Props = { readonly vehicle: vehicle }; - -export const $$default: React.ComponentType<{ readonly vehicle: vehicle }> = HooksJS.default as any; - -export default $$default; - -export type Another_anotherComponent_Props = { readonly callback: () => void; readonly vehicle: vehicle }; - -export const Another_anotherComponent: React.ComponentType<{ readonly callback: () => void; readonly vehicle: vehicle }> = HooksJS.Another.anotherComponent as any; - -export type Inner_make_Props = { readonly vehicle: vehicle }; - -export const Inner_make: React.ComponentType<{ readonly vehicle: vehicle }> = HooksJS.Inner.make as any; - -export type Inner_Another_anotherComponent_Props = { readonly vehicle: vehicle }; - -export const Inner_Another_anotherComponent: React.ComponentType<{ readonly vehicle: vehicle }> = HooksJS.Inner.Another.anotherComponent as any; - -export type Inner_Inner2_make_Props = { readonly vehicle: vehicle }; - -export const Inner_Inner2_make: React.ComponentType<{ readonly vehicle: vehicle }> = HooksJS.Inner.Inner2.make as any; - -export type Inner_Inner2_Another_anotherComponent_Props = { readonly vehicle: vehicle }; - -export const Inner_Inner2_Another_anotherComponent: React.ComponentType<{ readonly vehicle: vehicle }> = HooksJS.Inner.Inner2.Another.anotherComponent as any; - -export type NoProps_make_Props = {}; - -export const NoProps_make: React.ComponentType<{}> = HooksJS.NoProps.make as any; - -export const functionWithRenamedArgs: (_to:vehicle, _Type:vehicle, cb:cb) => string = HooksJS.functionWithRenamedArgs as any; - -export type WithRename_componentWithRenamedArgs_Props = { - readonly _Type: vehicle; - readonly _to: vehicle; - readonly cb: cb -}; - -export const WithRename_componentWithRenamedArgs: React.ComponentType<{ - readonly _Type: vehicle; - readonly _to: vehicle; - readonly cb: cb -}> = HooksJS.WithRename.componentWithRenamedArgs as any; - -export const WithRef_makeWithRef: (_1:{ readonly vehicle: vehicle }, _2:(null | undefined | any)) => JSX.Element = HooksJS.WithRef.makeWithRef as any; - -export type testForwardRef_Props = { readonly vehicle: vehicle }; - -export const testForwardRef: React.ComponentType<{ readonly vehicle: vehicle }> = HooksJS.testForwardRef as any; - -export type ForwardRef_input_Props = { readonly r: r }; - -export const ForwardRef_input: React.ComponentType<{ readonly r: r }> = HooksJS.ForwardRef.input as any; - -export type Poly_polymorphicComponent_Props = { readonly p: [vehicle, T1] }; - -export const Poly_polymorphicComponent: React.ComponentType<{ readonly p: [vehicle, any] }> = HooksJS.Poly.polymorphicComponent as any; - -export type Fun_functionReturningReactElement_Props = { readonly name: string }; - -export const Fun_functionReturningReactElement: React.ComponentType<{ readonly name: string }> = HooksJS.Fun.functionReturningReactElement as any; - -export type RenderPropRequiresConversion_make_Props = { readonly renderVehicle: React.ComponentType<{ readonly number: number; readonly vehicle: vehicle }> }; - -export const RenderPropRequiresConversion_make: React.ComponentType<{ readonly renderVehicle: React.ComponentType<{ readonly number: number; readonly vehicle: vehicle }> }> = HooksJS.RenderPropRequiresConversion.make as any; - -export type WithChildren_aComponentWithChildren_Props = { readonly children: React.ReactNode; readonly vehicle: vehicle }; - -export const WithChildren_aComponentWithChildren: React.ComponentType<{ readonly children: React.ReactNode; readonly vehicle: vehicle }> = HooksJS.WithChildren.aComponentWithChildren as any; - -export type DD_make_Props = { readonly array: Js_TypedArray2_Uint8Array_t; readonly name: string }; - -export const DD_make: React.ComponentType<{ readonly array: Js_TypedArray2_Uint8Array_t; readonly name: string }> = HooksJS.DD.make as any; - -export const NoProps: { make: React.ComponentType<{}> } = HooksJS.NoProps as any; - -export const Inner: { - Inner2: { - Another: { - anotherComponent: React.ComponentType<{ - readonly vehicle: vehicle - }> - }; - make: React.ComponentType<{ - readonly vehicle: vehicle - }> - }; - Another: { - anotherComponent: React.ComponentType<{ - readonly vehicle: vehicle - }> - }; - make: React.ComponentType<{ - readonly vehicle: vehicle - }> -} = HooksJS.Inner as any; - -export const RenderPropRequiresConversion: { make: React.ComponentType<{ readonly renderVehicle: React.ComponentType<{ readonly number: number; readonly vehicle: vehicle }> }> } = HooksJS.RenderPropRequiresConversion as any; - -export const WithRename: { componentWithRenamedArgs: React.ComponentType<{ - readonly _Type: vehicle; - readonly _to: vehicle; - readonly cb: cb -}> } = HooksJS.WithRename as any; - -export const ForwardRef: { input: React.ComponentType<{ readonly r: r }> } = HooksJS.ForwardRef as any; - -export const Fun: { functionReturningReactElement: React.ComponentType<{ readonly name: string }> } = HooksJS.Fun as any; - -export const WithRef: { makeWithRef: (_1:{ readonly vehicle: vehicle }, _2:(null | undefined | any)) => JSX.Element } = HooksJS.WithRef as any; - -export const WithChildren: { aComponentWithChildren: React.ComponentType<{ readonly children: React.ReactNode; readonly vehicle: vehicle }> } = HooksJS.WithChildren as any; - -export const DD: { make: React.ComponentType<{ readonly array: Js_TypedArray2_Uint8Array_t; readonly name: string }> } = HooksJS.DD as any; - -export const Another: { anotherComponent: React.ComponentType<{ readonly callback: () => void; readonly vehicle: vehicle }> } = HooksJS.Another as any; - -export const Poly: { polymorphicComponent: React.ComponentType<{ readonly p: [vehicle, any] }> } = HooksJS.Poly as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js b/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js deleted file mode 100644 index cd15d84f9d..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js +++ /dev/null @@ -1,223 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Curry from "rescript/lib/es6/curry.js"; -import * as React from "react"; -import * as ImportHooks from "./ImportHooks.res.js"; -import * as ImportHookDefault from "./ImportHookDefault.res.js"; - -function Hooks(Props) { - var vehicle = Props.vehicle; - var match = React.useState(function (param) { - return 0; - }); - var setCount = match[1]; - var count = match[0]; - return React.createElement("div", undefined, React.createElement("p", undefined, "Hooks example " + (vehicle.name + (" clicked " + (String(count) + " times")))), React.createElement("button", { - onClick: (function (param) { - Curry._1(setCount, (function (param) { - return count + 1 | 0; - })); - }) - }, "Click me"), React.createElement(ImportHooks.make, { - person: { - name: "Mary", - age: 71 - }, - children: null, - renderMe: (function (x) { - return x.randomString; - }) - }, "child1", "child2"), React.createElement(ImportHookDefault.make, { - person: { - name: "DefaultImport", - age: 42 - }, - children: null, - renderMe: (function (x) { - return x.randomString; - }) - }, "child1", "child2")); -} - -function Hooks$Another$anotherComponent(Props) { - var vehicle = Props.vehicle; - var callback = Props.callback; - Curry._1(callback, undefined); - return React.createElement("div", undefined, "Another Hook " + vehicle.name); -} - -var Another = { - anotherComponent: Hooks$Another$anotherComponent -}; - -function Hooks$Inner(Props) { - var vehicle = Props.vehicle; - return React.createElement("div", undefined, "Another Hook " + vehicle.name); -} - -function Hooks$Inner$Another$anotherComponent(Props) { - var vehicle = Props.vehicle; - return React.createElement("div", undefined, "Another Hook " + vehicle.name); -} - -var Another$1 = { - anotherComponent: Hooks$Inner$Another$anotherComponent -}; - -function Hooks$Inner$Inner2(Props) { - var vehicle = Props.vehicle; - return React.createElement("div", undefined, "Another Hook " + vehicle.name); -} - -function Hooks$Inner$Inner2$Another$anotherComponent(Props) { - var vehicle = Props.vehicle; - return React.createElement("div", undefined, "Another Hook " + vehicle.name); -} - -var Another$2 = { - anotherComponent: Hooks$Inner$Inner2$Another$anotherComponent -}; - -var Inner2 = { - make: Hooks$Inner$Inner2, - Another: Another$2 -}; - -var Inner = { - make: Hooks$Inner, - Another: Another$1, - Inner2: Inner2 -}; - -function Hooks$NoProps(Props) { - return React.createElement("div", undefined, null); -} - -var NoProps = { - make: Hooks$NoProps -}; - -function functionWithRenamedArgs(_to, _Type, cb) { - Curry._1(cb, _to); - return _to.name + _Type.name; -} - -function Hooks$WithRename$componentWithRenamedArgs(Props) { - var _to = Props._to; - var _Type = Props._Type; - var cb = Props.cb; - Curry._1(cb, _to); - return _to.name + _Type.name; -} - -var WithRename = { - componentWithRenamedArgs: Hooks$WithRename$componentWithRenamedArgs -}; - -function makeWithRef(vehicle) { - return function (ref) { - if (ref == null) { - return null; - } else { - return React.createElement("button", { - ref: ref - }, vehicle.name); - } - }; -} - -function Hooks$WithRef$makeWithRef(Props) { - return makeWithRef(Props.vehicle); -} - -var WithRef = { - makeWithRef: Hooks$WithRef$makeWithRef -}; - -var testForwardRef = React.forwardRef(function (param, param$1) { - return makeWithRef(param.vehicle)(param$1); - }); - -var input = React.forwardRef(function (Props, param) { - var partial_arg = Props.r; - return React.createElement("div", { - ref: param - }, partial_arg.x); - }); - -var ForwardRef = { - input: input -}; - -function Hooks$Poly$polymorphicComponent(Props) { - var param = Props.p; - return param[0].name; -} - -var Poly = { - polymorphicComponent: Hooks$Poly$polymorphicComponent -}; - -function Hooks$Fun$functionReturningReactElement(Props) { - return Props.name; -} - -var Fun = { - functionReturningReactElement: Hooks$Fun$functionReturningReactElement -}; - -function Hooks$RenderPropRequiresConversion(Props) { - var renderVehicle = Props.renderVehicle; - return Curry._1(renderVehicle, { - vehicle: { - name: "Car" - }, - number: 42 - }); -} - -var RenderPropRequiresConversion = { - make: Hooks$RenderPropRequiresConversion -}; - -function Hooks$WithChildren$aComponentWithChildren(Props) { - var vehicle = Props.vehicle; - var children = Props.children; - return React.createElement("div", undefined, "Another Hook " + vehicle.name, React.createElement("div", undefined, children)); -} - -var WithChildren = { - aComponentWithChildren: Hooks$WithChildren$aComponentWithChildren -}; - -function Hooks$DD(Props) { - var name = Props.name; - return name; -} - -var DD = { - make: Hooks$DD -}; - -var make = Hooks; - -var $$default = Hooks; - -export { - make , - $$default as default, - Another , - Inner , - NoProps , - functionWithRenamedArgs , - WithRename , - WithRef , - testForwardRef , - ForwardRef , - Poly , - Fun , - RenderPropRequiresConversion , - WithChildren , - DD , -} -/* testForwardRef Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/IgnoreInterface.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/IgnoreInterface.gen.tsx deleted file mode 100644 index e1da44fd51..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/IgnoreInterface.gen.tsx +++ /dev/null @@ -1,6 +0,0 @@ -/* TypeScript file generated from IgnoreInterface.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type t = number; diff --git a/jscomp/gentype_tests/typescript-react-example/src/IgnoreInterface.res.js b/jscomp/gentype_tests/typescript-react-example/src/IgnoreInterface.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/IgnoreInterface.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js deleted file mode 100644 index e443f7f254..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js +++ /dev/null @@ -1,210 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Belt_Array from "rescript/lib/es6/belt_Array.js"; - -function fromArray(a) { - return a.slice(0); -} - -function toArray(a) { - return a.slice(0); -} - -function length(a) { - return a.length; -} - -function size(a) { - return a.length; -} - -var get = Belt_Array.get; - -var getExn = Belt_Array.getExn; - -function getUnsafe(a, x) { - return a[x]; -} - -function getUndefined(a, x) { - return a[x]; -} - -var shuffle = Belt_Array.shuffle; - -var reverse = Belt_Array.reverse; - -function makeUninitialized(x) { - return new Array(x); -} - -function makeUninitializedUnsafe(x) { - return new Array(x); -} - -var make = Belt_Array.make; - -var range = Belt_Array.range; - -var rangeBy = Belt_Array.rangeBy; - -var makeByU = Belt_Array.makeByU; - -var makeBy = Belt_Array.makeBy; - -var makeByAndShuffleU = Belt_Array.makeByAndShuffleU; - -var makeByAndShuffle = Belt_Array.makeByAndShuffle; - -var zip = Belt_Array.zip; - -var zipByU = Belt_Array.zipByU; - -var zipBy = Belt_Array.zipBy; - -var unzip = Belt_Array.unzip; - -var concat = Belt_Array.concat; - -var concatMany = Belt_Array.concatMany; - -var slice = Belt_Array.slice; - -var sliceToEnd = Belt_Array.sliceToEnd; - -function copy(a) { - return a.slice(0); -} - -var forEachU = Belt_Array.forEachU; - -var forEach = Belt_Array.forEach; - -var mapU = Belt_Array.mapU; - -var map = Belt_Array.map; - -var keepWithIndexU = Belt_Array.keepWithIndexU; - -var keepWithIndex = Belt_Array.keepWithIndex; - -var keepMapU = Belt_Array.keepMapU; - -var keepMap = Belt_Array.keepMap; - -var forEachWithIndexU = Belt_Array.forEachWithIndexU; - -var forEachWithIndex = Belt_Array.forEachWithIndex; - -var mapWithIndexU = Belt_Array.mapWithIndexU; - -var mapWithIndex = Belt_Array.mapWithIndex; - -var partitionU = Belt_Array.partitionU; - -var partition = Belt_Array.partition; - -var reduceU = Belt_Array.reduceU; - -var reduce = Belt_Array.reduce; - -var reduceReverseU = Belt_Array.reduceReverseU; - -var reduceReverse = Belt_Array.reduceReverse; - -var reduceReverse2U = Belt_Array.reduceReverse2U; - -var reduceReverse2 = Belt_Array.reduceReverse2; - -var someU = Belt_Array.someU; - -var some = Belt_Array.some; - -var everyU = Belt_Array.everyU; - -var every = Belt_Array.every; - -var every2U = Belt_Array.every2U; - -var every2 = Belt_Array.every2; - -var some2U = Belt_Array.some2U; - -var some2 = Belt_Array.some2; - -var cmpU = Belt_Array.cmpU; - -var cmp = Belt_Array.cmp; - -var eqU = Belt_Array.eqU; - -var eq = Belt_Array.eq; - -var $$Array$1 = { - get: get -}; - -export { - $$Array$1 as $$Array, - fromArray , - toArray , - length , - size , - get , - getExn , - getUnsafe , - getUndefined , - shuffle , - reverse , - makeUninitialized , - makeUninitializedUnsafe , - make , - range , - rangeBy , - makeByU , - makeBy , - makeByAndShuffleU , - makeByAndShuffle , - zip , - zipByU , - zipBy , - unzip , - concat , - concatMany , - slice , - sliceToEnd , - copy , - forEachU , - forEach , - mapU , - map , - keepWithIndexU , - keepWithIndex , - keepMapU , - keepMap , - forEachWithIndexU , - forEachWithIndex , - mapWithIndexU , - mapWithIndex , - partitionU , - partition , - reduceU , - reduce , - reduceReverseU , - reduceReverse , - reduceReverse2U , - reduceReverse2 , - someU , - some , - everyU , - every , - every2U , - every2 , - some2U , - some2 , - cmpU , - cmp , - eqU , - eq , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportHookDefault.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/ImportHookDefault.gen.tsx deleted file mode 100644 index e478b2fd07..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportHookDefault.gen.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/* TypeScript file generated from ImportHookDefault.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import {default as makeNotChecked} from './hookExample'; - -import {default as defaultNotChecked} from './hookExample'; - -// In case of type error, check the type of 'make' in 'ImportHookDefault.res' and './hookExample'. -export const makeTypeChecked: React.ComponentType<{ - readonly person: person; - readonly children: React.ReactNode; - readonly renderMe: ImportHooks_renderMe -}> = makeNotChecked as any; - -// Export 'make' early to allow circular import from the '.bs.js' file. -export const make: unknown = makeTypeChecked as React.ComponentType<{ - readonly person: person; - readonly children: React.ReactNode; - readonly renderMe: ImportHooks_renderMe -}> as any; - -// In case of type error, check the type of 'default' in 'ImportHookDefault.res' and './hookExample'. -export const defaultTypeChecked: React.ComponentType<{ - readonly person: person; - readonly children: React.ReactNode; - readonly renderMe: ImportHooks_renderMe -}> = defaultNotChecked as any; - -// Export '$$default' early to allow circular import from the '.bs.js' file. -export const $$default: unknown = defaultTypeChecked as React.ComponentType<{ - readonly person: person; - readonly children: React.ReactNode; - readonly renderMe: ImportHooks_renderMe -}> as any; - -import type {renderMe as ImportHooks_renderMe} from './ImportHooks.gen'; - -export type person = { readonly name: string; readonly age: number }; - -export default $$default; diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportHookDefault.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImportHookDefault.res.js deleted file mode 100644 index 6356fbdd4c..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportHookDefault.res.js +++ /dev/null @@ -1,18 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import ImportHookDefaultGen from "./ImportHookDefault.gen"; -import * as ImportHookDefaultGen$1 from "./ImportHookDefault.gen"; - -var make = ImportHookDefaultGen$1.make; - -var make2 = ImportHookDefaultGen; - -var MM = { - make2: make2 -}; - -export { - make , - MM , -} -/* make Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportHooks.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/ImportHooks.gen.tsx deleted file mode 100644 index f05bfbbd57..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportHooks.gen.tsx +++ /dev/null @@ -1,34 +0,0 @@ -/* TypeScript file generated from ImportHooks.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import {makeRenamed as makeRenamedNotChecked} from './hookExample'; - -import {foo as fooNotChecked} from './hookExample'; - -// In case of type error, check the type of 'makeRenamed' in 'ImportHooks.res' and './hookExample'. -export const makeRenamedTypeChecked: React.ComponentType<{ - readonly actions?: JSX.Element; - readonly person: person; - readonly children: React.ReactNode; - readonly renderMe: renderMe -}> = makeRenamedNotChecked as any; - -// Export 'makeRenamed' early to allow circular import from the '.bs.js' file. -export const makeRenamed: unknown = makeRenamedTypeChecked as React.ComponentType<{ - readonly actions?: JSX.Element; - readonly person: person; - readonly children: React.ReactNode; - readonly renderMe: renderMe -}> as any; - -// In case of type error, check the type of 'foo' in 'ImportHooks.res' and './hookExample'. -export const fooTypeChecked: (person:person) => string = fooNotChecked as any; - -// Export 'foo' early to allow circular import from the '.bs.js' file. -export const foo: unknown = fooTypeChecked as (person:person) => string as any; - -export type person = { readonly name: string; readonly age: number }; - -export type renderMe = React.ComponentType<{ readonly randomString: string; readonly poly: a }>; diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportHooks.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImportHooks.res.js deleted file mode 100644 index 0a3f6aa513..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportHooks.res.js +++ /dev/null @@ -1,15 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as ImportHooksGen from "./ImportHooks.gen"; - -var make = ImportHooksGen.makeRenamed; - -function foo(prim) { - return ImportHooksGen.foo(prim); -} - -export { - make , - foo , -} -/* make Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportIndex.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/ImportIndex.gen.tsx deleted file mode 100644 index d55ef23ca6..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportIndex.gen.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* TypeScript file generated from ImportIndex.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import {default as defaultNotChecked} from './'; - -// In case of type error, check the type of 'default' in 'ImportIndex.res' and './'. -export const defaultTypeChecked: React.ComponentType<{ readonly method?: "push" | "replace" }> = defaultNotChecked as any; - -// Export '$$default' early to allow circular import from the '.bs.js' file. -export const $$default: unknown = defaultTypeChecked as React.ComponentType<{ readonly method?: "push" | "replace" }> as any; - -export default $$default; diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportIndex.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImportIndex.res.js deleted file mode 100644 index f8da735e19..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportIndex.res.js +++ /dev/null @@ -1,10 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import ImportIndexGen from "./ImportIndex.gen"; - -var make = ImportIndexGen; - -export { - make , -} -/* make Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.gen.tsx deleted file mode 100644 index 96acb5ab48..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.gen.tsx +++ /dev/null @@ -1,122 +0,0 @@ -/* TypeScript file generated from ImportJsValue.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import {round as roundNotChecked} from './MyMath'; - -import {round2 as round2NotChecked} from './MyMath'; - -import {area as areaNotChecked} from './MyMath'; - -import {returnMixedArray as returnMixedArrayNotChecked} from './MyMath'; - -import {useColor as useColorNotChecked} from './MyMath'; - -import {higherOrder as higherOrderNotChecked} from './MyMath'; - -import {convertVariant as convertVariantNotChecked} from './MyMath'; - -import {polymorphic as polymorphicNotChecked} from './MyMath'; - -import {default as defaultNotChecked} from './MyMath'; - -// In case of type error, check the type of 'round' in 'ImportJsValue.res' and './MyMath'. -export const roundTypeChecked: (_1:number) => number = roundNotChecked as any; - -// Export 'round' early to allow circular import from the '.bs.js' file. -export const round: unknown = roundTypeChecked as (_1:number) => number as any; - -// In case of type error, check the type of 'round2' in 'ImportJsValue.res' and './MyMath'. -export const round2TypeChecked: (_1:number) => number = round2NotChecked as any; - -// Export 'round2' early to allow circular import from the '.bs.js' file. -export const round2: unknown = round2TypeChecked as (_1:number) => number as any; - -// In case of type error, check the type of 'area' in 'ImportJsValue.res' and './MyMath'. -export const areaTypeChecked: (_1:point) => number = areaNotChecked as any; - -// Export 'area' early to allow circular import from the '.bs.js' file. -export const area: unknown = areaTypeChecked as (_1:point) => number as any; - -// In case of type error, check the type of 'returnMixedArray' in 'ImportJsValue.res' and './MyMath'. -export const returnMixedArrayTypeChecked: () => numberOrString[] = returnMixedArrayNotChecked as any; - -// Export 'returnMixedArray' early to allow circular import from the '.bs.js' file. -export const returnMixedArray: unknown = returnMixedArrayTypeChecked as () => numberOrString[] as any; - -// In case of type error, check the type of 'useColor' in 'ImportJsValue.res' and './MyMath'. -export const useColorTypeChecked: (_1:color) => number = useColorNotChecked as any; - -// Export 'useColor' early to allow circular import from the '.bs.js' file. -export const useColor: unknown = useColorTypeChecked as (_1:color) => number as any; - -// In case of type error, check the type of 'higherOrder' in 'ImportJsValue.res' and './MyMath'. -export const higherOrderTypeChecked: (_1:((_1:number, _2:number) => number)) => number = higherOrderNotChecked as any; - -// Export 'higherOrder' early to allow circular import from the '.bs.js' file. -export const higherOrder: unknown = higherOrderTypeChecked as (_1:((_1:number, _2:number) => number)) => number as any; - -// In case of type error, check the type of 'convertVariant' in 'ImportJsValue.res' and './MyMath'. -export const convertVariantTypeChecked: (_1:variant) => variant = convertVariantNotChecked as any; - -// Export 'convertVariant' early to allow circular import from the '.bs.js' file. -export const convertVariant: unknown = convertVariantTypeChecked as (_1:variant) => variant as any; - -// In case of type error, check the type of 'polymorphic' in 'ImportJsValue.res' and './MyMath'. -export const polymorphicTypeChecked: (_1:a) => a = polymorphicNotChecked as any; - -// Export 'polymorphic' early to allow circular import from the '.bs.js' file. -export const polymorphic: unknown = polymorphicTypeChecked as (_1:a) => a as any; - -// In case of type error, check the type of 'default' in 'ImportJsValue.res' and './MyMath'. -export const defaultTypeChecked: number = defaultNotChecked as any; - -// Export '$$default' early to allow circular import from the '.bs.js' file. -export const $$default: unknown = defaultTypeChecked as number as any; - -const ImportJsValueJS = require('./ImportJsValue.res.js'); - -import type {AbsoluteValue as $$AbsoluteValue_t} from './MyMath'; - -import type {num as $$myNum} from './MyMath'; - -import type {num as $$num} from './MyMath'; - -import type {numberOrString as $$numberOrString} from './MyMath'; - -import type {polyType as $$polyType} from './MyMath'; - -import type {stringFunction as $$stringFunction} from './MyMath'; - -export type point = { readonly x: number; readonly y: (undefined | number) }; - -export type numberOrString = $$numberOrString; - -export type AbsoluteValue_t = $$AbsoluteValue_t; - -export type stringFunction = $$stringFunction; - -export type color = "tomato" | "gray"; - -export type variant = - { TAG: "I"; _0: number } - | { TAG: "S"; _0: string }; - -export type num = $$num; - -export type myNum = $$myNum; - -export type polyType = $$polyType; - -export const roundedNumber: number = ImportJsValueJS.roundedNumber as any; - -export const areaValue: number = ImportJsValueJS.areaValue as any; - -export const useGetProp: (x:AbsoluteValue_t) => number = ImportJsValueJS.useGetProp as any; - -export const useGetAbs: (x:AbsoluteValue_t) => number = ImportJsValueJS.useGetAbs as any; - -export const returnedFromHigherOrder: number = ImportJsValueJS.returnedFromHigherOrder as any; - -export default $$default; diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js deleted file mode 100644 index 69f8ca32c7..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js +++ /dev/null @@ -1,85 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import ImportJsValueGen from "./ImportJsValue.gen"; -import * as ImportJsValueGen$1 from "./ImportJsValue.gen"; - -function round(prim) { - return ImportJsValueGen$1.round(prim); -} - -function round2(prim) { - return ImportJsValueGen$1.round2(prim); -} - -function area(prim) { - return ImportJsValueGen$1.area(prim); -} - -function returnMixedArray(prim) { - return ImportJsValueGen$1.returnMixedArray(); -} - -var roundedNumber = ImportJsValueGen$1.round(1.8); - -var areaValue = ImportJsValueGen$1.area({ - x: 3, - y: undefined - }); - -function getAbs(x) { - var getAbs$1 = x.getAbs; - return getAbs$1(); -} - -var AbsoluteValue = { - getAbs: getAbs -}; - -function useGetProp(x) { - return x.getProp() + 1 | 0; -} - -function useGetAbs(x) { - return getAbs(x) + 1 | 0; -} - -function useColor(prim) { - return ImportJsValueGen$1.useColor(prim); -} - -function higherOrder(prim) { - return ImportJsValueGen$1.higherOrder(prim); -} - -var returnedFromHigherOrder = ImportJsValueGen$1.higherOrder(function (prim0, prim1) { - return prim0 + prim1 | 0; - }); - -function convertVariant(prim) { - return ImportJsValueGen$1.convertVariant(prim); -} - -function polymorphic(prim) { - return ImportJsValueGen$1.polymorphic(prim); -} - -var $$default = ImportJsValueGen; - -export { - round , - round2 , - area , - returnMixedArray , - roundedNumber , - areaValue , - AbsoluteValue , - useGetProp , - useGetAbs , - useColor , - higherOrder , - returnedFromHigherOrder , - convertVariant , - polymorphic , - $$default as default, -} -/* roundedNumber Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Inherits.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Inherits.gen.tsx deleted file mode 100644 index 29faeb762f..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Inherits.gen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* TypeScript file generated from Inherits.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type red = "Ruby" | "Redwood" | "Rust"; - -export type blue = "Sapphire" | "Neon" | "Navy"; - -export type color = red | blue; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Inherits.res.js b/jscomp/gentype_tests/typescript-react-example/src/Inherits.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Inherits.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/InnerModuleSignature.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/InnerModuleSignature.gen.tsx deleted file mode 100644 index f5e9015cbe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/InnerModuleSignature.gen.tsx +++ /dev/null @@ -1,12 +0,0 @@ -/* TypeScript file generated from InnerModuleSignature.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as InnerModuleSignatureJS from './InnerModuleSignature.res.js'; - -export type InnerModule_t = string; - -export const InnerModule_make: (_1:InnerModule_t) => string = InnerModuleSignatureJS.InnerModule.make as any; - -export const InnerModule: { make: (_1:InnerModule_t) => string } = InnerModuleSignatureJS.InnerModule as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/InnerModuleSignature.res.js b/jscomp/gentype_tests/typescript-react-example/src/InnerModuleSignature.res.js deleted file mode 100644 index db7df4631b..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/InnerModuleSignature.res.js +++ /dev/null @@ -1,15 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function make(t) { - return t + "..."; -} - -var InnerModule = { - make: make -}; - -export { - InnerModule , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/JSResource.res.js b/jscomp/gentype_tests/typescript-react-example/src/JSResource.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/JSResource.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/JSXV4.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/JSXV4.gen.tsx deleted file mode 100644 index 1d627f900d..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/JSXV4.gen.tsx +++ /dev/null @@ -1,49 +0,0 @@ -/* TypeScript file generated from JSXV4.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import {make as makeNotChecked} from './hookExample'; - -import * as React from 'react'; - -// In case of type error, check the type of 'make' in 'JSXV4.res' and './hookExample'. -export const makeTypeChecked: React.ComponentType<{ - readonly actions?: JSX.Element; - readonly person: person; - readonly children: React.ReactNode; - readonly renderMe: renderMe -}> = makeNotChecked as any; - -// Export 'make' early to allow circular import from the '.bs.js' file. -export const make: unknown = makeTypeChecked as React.ComponentType<{ - readonly actions?: JSX.Element; - readonly person: person; - readonly children: React.ReactNode; - readonly renderMe: renderMe -}> as any; - -const JSXV4JS = require('./JSXV4.res.js'); - -export type CompV4_props = { readonly x: x; readonly y: y }; - -export type person = { readonly name: string; readonly age: number }; - -export type renderMe = React.ComponentType<{ readonly randomString: string; readonly poly: a }>; - -export type props = { - readonly actions?: actions; - readonly person: person; - readonly children: children; - readonly renderMe: renderMe -}; - -export const CompV4_make: React.ComponentType<{ readonly x: string; readonly y: string }> = JSXV4JS.CompV4.make as any; - -export type Props = { readonly x: string; readonly y: string }; - -export const CompV3_make: React.ComponentType<{ readonly x: string; readonly y: string }> = JSXV4JS.CompV3.make as any; - -export const CompV3: { make: React.ComponentType<{ readonly x: string; readonly y: string }> } = JSXV4JS.CompV3 as any; - -export const CompV4: { make: React.ComponentType<{ readonly x: string; readonly y: string }> } = JSXV4JS.CompV4 as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/JSXV4.res.js b/jscomp/gentype_tests/typescript-react-example/src/JSXV4.res.js deleted file mode 100644 index 7fec15984d..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/JSXV4.res.js +++ /dev/null @@ -1,28 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as JSXV4Gen from "./JSXV4.gen"; - -function JSXV4$CompV4(props) { - return props.x + props.y; -} - -var CompV4 = { - make: JSXV4$CompV4 -}; - -function JSXV4$CompV3(Props) { - return Props.x + Props.y; -} - -var CompV3 = { - make: JSXV4$CompV3 -}; - -var make = JSXV4Gen.make; - -export { - CompV4 , - CompV3 , - make , -} -/* make Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/LabeledFun.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/LabeledFun.gen.tsx deleted file mode 100644 index dad8e55edb..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/LabeledFun.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from LabeledFun.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as LabeledFunJS from './LabeledFun.res.js'; - -export const labelled: (a:number, b:(undefined | number), c:number, _4:number, e:number, f:number) => number = LabeledFunJS.labelled as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/LabeledFun.res.js b/jscomp/gentype_tests/typescript-react-example/src/LabeledFun.res.js deleted file mode 100644 index 2be82a13b9..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/LabeledFun.res.js +++ /dev/null @@ -1,12 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function labelled(a, bOpt, c, d, e, f) { - var b = bOpt !== undefined ? bOpt : 3; - return ((((a + b | 0) + c | 0) + d | 0) + e | 0) + f | 0; -} - -export { - labelled , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/LetPrivate.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/LetPrivate.gen.tsx deleted file mode 100644 index 4e8a975cbd..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/LetPrivate.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from LetPrivate.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as LetPrivateJS from './LetPrivate.res.js'; - -export const y: number = LetPrivateJS.y as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/LetPrivate.res.js b/jscomp/gentype_tests/typescript-react-example/src/LetPrivate.res.js deleted file mode 100644 index d8727696b1..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/LetPrivate.res.js +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var y = 34; - -export { - y , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Lib.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Lib.gen.tsx deleted file mode 100644 index 83b8e67073..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Lib.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from Lib.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type action = - { action: "A"; _0: string } - | { action: "B"; _0: string }; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Lib.res.js b/jscomp/gentype_tests/typescript-react-example/src/Lib.res.js deleted file mode 100644 index 744468f41f..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Lib.res.js +++ /dev/null @@ -1,18 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var a = { - action: "A", - _0: "a" -}; - -var b = { - action: "B", - _0: "b" -}; - -export { - a , - b , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Machine.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Machine.gen.tsx deleted file mode 100644 index 9f96470cc4..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Machine.gen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* TypeScript file generated from Machine.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as MachineJS from './Machine.res.js'; - -export type aa = { TAG: "A"; _0: number }; - -export const a: aa = MachineJS.a as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Machine.res.js b/jscomp/gentype_tests/typescript-react-example/src/Machine.res.js deleted file mode 100644 index 6ec89819c8..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Machine.res.js +++ /dev/null @@ -1,12 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var a = { - TAG: "A", - _0: 3 -}; - -export { - a , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Map_.res.js b/jscomp/gentype_tests/typescript-react-example/src/Map_.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Map_.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases.gen.tsx deleted file mode 100644 index 6f6a95ed95..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases.gen.tsx +++ /dev/null @@ -1,26 +0,0 @@ -/* TypeScript file generated from ModuleAliases.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as ModuleAliasesJS from './ModuleAliases.res.js'; - -export type Outer_Inner_innerT = { readonly inner: string }; - -export type Outer2_Inner2_InnerNested_t = { readonly nested: number }; - -export type Outer2_OuterInnerAlias_innerT = Outer_Inner_innerT; - -export type Outer2_Inner2_OuterInnerAlias2_innerT = Outer2_OuterInnerAlias_innerT; - -export type Outer2Alias_OuterInnerAlias_innerT = Outer2_OuterInnerAlias_innerT; - -export type Outer2Alias_Inner2_OuterInnerAlias2_innerT = Outer2_Inner2_OuterInnerAlias2_innerT; - -export type InnerNestedAlias_t = Outer2_Inner2_InnerNested_t; - -export const testNested: (x:InnerNestedAlias_t) => InnerNestedAlias_t = ModuleAliasesJS.testNested as any; - -export const testInner: (x:Outer2Alias_OuterInnerAlias_innerT) => Outer2Alias_OuterInnerAlias_innerT = ModuleAliasesJS.testInner as any; - -export const testInner2: (x:Outer2Alias_Inner2_OuterInnerAlias2_innerT) => Outer2Alias_Inner2_OuterInnerAlias2_innerT = ModuleAliasesJS.testInner2 as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases.res.js b/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases.res.js deleted file mode 100644 index 0ff799c80a..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases.res.js +++ /dev/null @@ -1,47 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var Inner = {}; - -var Outer = { - Inner: Inner -}; - -var InnerNested = {}; - -var Inner2 = { - InnerNested: InnerNested, - OuterInnerAlias2: undefined -}; - -var Outer2 = { - OuterInnerAlias: undefined, - Inner2: Inner2 -}; - -function testNested(x) { - return x; -} - -function testInner(x) { - return x; -} - -function testInner2(x) { - return x; -} - -var Outer2Alias; - -var InnerNestedAlias; - -export { - Outer , - Outer2 , - Outer2Alias , - InnerNestedAlias , - testNested , - testInner , - testInner2 , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases2.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases2.gen.tsx deleted file mode 100644 index e5cf11bca5..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases2.gen.tsx +++ /dev/null @@ -1,16 +0,0 @@ -/* TypeScript file generated from ModuleAliases2.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type record = { readonly x: number; readonly y: string }; - -export type Outer_outer = { readonly outer: string }; - -export type Outer_Inner_inner = { readonly inner: string }; - -export type OuterAlias_outer = Outer_outer; - -export type OuterAlias_Inner_inner = Outer_Inner_inner; - -export type InnerAlias_inner = OuterAlias_Inner_inner; diff --git a/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases2.res.js b/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases2.res.js deleted file mode 100644 index 4be3b8371a..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ModuleAliases2.res.js +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var Inner = {}; - -var Outer = { - Inner: Inner -}; - -var OuterAlias; - -var InnerAlias; - -var q = 42; - -export { - Outer , - OuterAlias , - InnerAlias , - q , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution1.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution1.gen.tsx deleted file mode 100644 index 3fe5123d7e..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution1.gen.tsx +++ /dev/null @@ -1,6 +0,0 @@ -/* TypeScript file generated from ModuleResolution1.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type t1 = { readonly foo: string; readonly bar: number }; diff --git a/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution1.res.js b/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution1.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution1.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution2.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution2.gen.tsx deleted file mode 100644 index d9e793ef63..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution2.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from ModuleResolution2.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import type {t1 as ModuleResolution1_t1} from './ModuleResolution1.gen'; - -export type t2 = { readonly dependency: ModuleResolution1_t1 }; diff --git a/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution2.res.js b/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution2.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/ModuleResolution2.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/MoreVariants.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/MoreVariants.gen.tsx deleted file mode 100644 index 9da02967f9..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/MoreVariants.gen.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* TypeScript file generated from MoreVariants.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as MoreVariantsJS from './MoreVariants.res.js'; - -export type withRenaming = "type_" | "b"; - -export type withoutRenaming = "type_" | "b"; - -export const testWithRenaming: (x:withRenaming) => withRenaming = MoreVariantsJS.testWithRenaming as any; - -export const testWithoutRenaming: (x:withoutRenaming) => withoutRenaming = MoreVariantsJS.testWithoutRenaming as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/MoreVariants.res.js b/jscomp/gentype_tests/typescript-react-example/src/MoreVariants.res.js deleted file mode 100644 index 833cc29532..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/MoreVariants.res.js +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function testWithRenaming(x) { - return x; -} - -function testWithoutRenaming(x) { - return x; -} - -export { - testWithRenaming , - testWithoutRenaming , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/MyInput.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/MyInput.gen.tsx deleted file mode 100644 index ad85bb45cf..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/MyInput.gen.tsx +++ /dev/null @@ -1,18 +0,0 @@ -/* TypeScript file generated from MyInput.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import {default as defaultNotChecked} from './MyInput'; - -// In case of type error, check the type of 'default' in 'MyInput.res' and './MyInput'. -export const defaultTypeChecked: React.ComponentType<{ readonly onFocus?: (_1:inputFocusEvent) => void }> = defaultNotChecked as any; - -// Export '$$default' early to allow circular import from the '.bs.js' file. -export const $$default: unknown = defaultTypeChecked as React.ComponentType<{ readonly onFocus?: (_1:inputFocusEvent) => void }> as any; - -import type {inputFocusEvent as $$inputFocusEvent} from './shims/ReactEvent.shim'; - -export type inputFocusEvent = $$inputFocusEvent; - -export default $$default; diff --git a/jscomp/gentype_tests/typescript-react-example/src/MyInput.res.js b/jscomp/gentype_tests/typescript-react-example/src/MyInput.res.js deleted file mode 100644 index 3aa6ca7d77..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/MyInput.res.js +++ /dev/null @@ -1,10 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import MyInputGen from "./MyInput.gen"; - -var make = MyInputGen; - -export { - make , -} -/* make Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/MyModule.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/MyModule.gen.tsx deleted file mode 100644 index 37a3a3bf4a..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/MyModule.gen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* TypeScript file generated from MyModule.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as MyModuleJS from './MyModule.res.js'; - -export type t = number; - -export const add: (a:t, b:t) => t = MyModuleJS.add as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/MyModule.res.js b/jscomp/gentype_tests/typescript-react-example/src/MyModule.res.js deleted file mode 100644 index 3377033068..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/MyModule.res.js +++ /dev/null @@ -1,11 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function add(a, b) { - return a + b | 0; -} - -export { - add , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/NestedModules.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/NestedModules.gen.tsx deleted file mode 100644 index ad6d2fa301..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NestedModules.gen.tsx +++ /dev/null @@ -1,41 +0,0 @@ -/* TypeScript file generated from NestedModules.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as NestedModulesJS from './NestedModules.res.js'; - -export type Universe_nestedType = string[]; - -export type Universe_Nested2_nested2Type = Array; - -export type Universe_Nested2_Nested3_nested3Type = Array>; - -export type Universe_variant = "A" | { TAG: "B"; _0: string }; - -export const notNested: number = NestedModulesJS.notNested as any; - -export const Universe_theAnswer: number = NestedModulesJS.Universe.theAnswer as any; - -export const Universe_Nested2_nested2Value: number = NestedModulesJS.Universe.Nested2.nested2Value as any; - -export const Universe_Nested2_Nested3_nested3Value: string = NestedModulesJS.Universe.Nested2.Nested3.nested3Value as any; - -export const Universe_Nested2_Nested3_nested3Function: (x:Universe_Nested2_nested2Type) => Universe_Nested2_nested2Type = NestedModulesJS.Universe.Nested2.Nested3.nested3Function as any; - -export const Universe_Nested2_nested2Function: (x:Universe_Nested2_Nested3_nested3Type) => Universe_Nested2_Nested3_nested3Type = NestedModulesJS.Universe.Nested2.nested2Function as any; - -export const Universe_someString: string = NestedModulesJS.Universe.someString as any; - -export const Universe: { - theAnswer: number; - Nested2: { - nested2Function: (x:Universe_Nested2_Nested3_nested3Type) => Universe_Nested2_Nested3_nested3Type; - nested2Value: number; - Nested3: { - nested3Value: string; - nested3Function: (x:Universe_Nested2_nested2Type) => Universe_Nested2_nested2Type - } - }; - someString: string -} = NestedModulesJS.Universe as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/NestedModules.res.js b/jscomp/gentype_tests/typescript-react-example/src/NestedModules.res.js deleted file mode 100644 index 654fd2e5ad..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NestedModules.res.js +++ /dev/null @@ -1,42 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function nested3Function(x) { - return x; -} - -var Nested3 = { - x: 0, - y: 1, - z: 2, - w: 3, - nested3Value: "nested3Value", - nested3Function: nested3Function -}; - -function nested2Function(x) { - return x; -} - -var Nested2 = { - x: 0, - nested2Value: 1, - y: 2, - Nested3: Nested3, - nested2Function: nested2Function -}; - -var Universe = { - theAnswer: 42, - notExported: 33, - Nested2: Nested2, - someString: "some exported string" -}; - -var notNested = 1; - -export { - notNested , - Universe , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/NestedModulesInSignature.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/NestedModulesInSignature.gen.tsx deleted file mode 100644 index 2e4577ba53..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NestedModulesInSignature.gen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* TypeScript file generated from NestedModulesInSignature.resi by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as NestedModulesInSignatureJS from './NestedModulesInSignature.res.js'; - -export const Universe_theAnswer: number = NestedModulesInSignatureJS.Universe.theAnswer as any; - -export const Universe: { theAnswer: number } = NestedModulesInSignatureJS.Universe as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/NestedModulesInSignature.res.js b/jscomp/gentype_tests/typescript-react-example/src/NestedModulesInSignature.res.js deleted file mode 100644 index 394291d726..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NestedModulesInSignature.res.js +++ /dev/null @@ -1,11 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var Universe = { - theAnswer: 42 -}; - -export { - Universe , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.gen.tsx deleted file mode 100644 index 529c7e7fab..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.gen.tsx +++ /dev/null @@ -1,71 +0,0 @@ -/* TypeScript file generated from NestedVariants.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as NestedVariantsJS from './NestedVariants.res.js'; - -export type typeL = - { TAG: "NonUnary"; _0: number; _1: number }; - -export type typeC = - { TAG: "C"; _0: string } - | { TAG: "D"; _0: string }; - -export type typeB = { readonly c: typeC }; - -export type typeD = { TAG: "Int"; _0: number }; - -export type typeE = number; - -export type typeA = - { TAG: "A"; _0: a; _1: number } - | { TAG: "B"; _0: a; _1: number }; - -export type typeF = { TAG: "F"; _0: a } | { TAG: "G"; _0: a }; - -export type typeH = - { TAG: "H"; _0: typeD; _1: number } - | { TAG: "I"; _0: typeD; _1: number }; - -export type typeJ = { TAG: "J"; _0: typeD; _1: typeD }; - -export type typeK = { TAG: "K"; _0: typeD; _1: typeD }; - -export type boxedBinary = - { TAG: "BB"; _0: typeD; _1: number } - | { TAG: "Z"; _0: number }; - -export type unboxedBinary = { TAG: "UB"; _0: typeD; _1: number }; - -export type inline = - { TAG: "I"; readonly i: number; readonly j: number } - | { TAG: "J"; readonly i: number; readonly j: number } - | { TAG: "K"; _0: number; _1: number } - | { TAG: "L"; _0: { readonly j: number; readonly i: number } }; - -export const makeVariant: () => typeL = NestedVariantsJS.makeVariant as any; - -export const makeABC: () => typeA = NestedVariantsJS.makeABC as any; - -export const makeBC: () => typeB = NestedVariantsJS.makeBC as any; - -export const makeAC: () => typeA = NestedVariantsJS.makeAC as any; - -export const makeAD: () => typeA = NestedVariantsJS.makeAD as any; - -export const makeAE: () => typeA = NestedVariantsJS.makeAE as any; - -export const makeFD: () => typeF = NestedVariantsJS.makeFD as any; - -export const makeHD: () => typeH = NestedVariantsJS.makeHD as any; - -export const makeJ: () => typeJ = NestedVariantsJS.makeJ as any; - -export const makeK: () => typeK = NestedVariantsJS.makeK as any; - -export const testBoxedBinary: (param:boxedBinary) => number = NestedVariantsJS.testBoxedBinary as any; - -export const testUnboxedBinary: (param:unboxedBinary) => number = NestedVariantsJS.testUnboxedBinary as any; - -export const testInline: (x:inline) => inline = NestedVariantsJS.testInline as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.res.js b/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.res.js deleted file mode 100644 index 81711cbe59..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.res.js +++ /dev/null @@ -1,163 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function makeVariant(param) { - return { - TAG: "NonUnary", - _0: 5, - _1: 3 - }; -} - -function makeABC(param) { - return { - TAG: "A", - _0: { - c: { - TAG: "C", - _0: "a string" - } - }, - _1: 5 - }; -} - -function makeBC(param) { - return { - c: { - TAG: "C", - _0: "a string" - } - }; -} - -function makeAC(param) { - return { - TAG: "A", - _0: { - TAG: "C", - _0: "a string" - }, - _1: 5 - }; -} - -function makeAD(param) { - return { - TAG: "A", - _0: { - TAG: "Int", - _0: 3 - }, - _1: 5 - }; -} - -function makeAE(param) { - return { - TAG: "A", - _0: 3, - _1: 5 - }; -} - -function makeFD(param) { - return { - TAG: "F", - _0: { - TAG: "Int", - _0: 3 - } - }; -} - -function makeHD(param) { - return { - TAG: "H", - _0: { - TAG: "Int", - _0: 5 - }, - _1: 5 - }; -} - -function makeJ(param) { - return { - TAG: "J", - _0: { - TAG: "Int", - _0: 5 - }, - _1: { - TAG: "Int", - _0: 3 - } - }; -} - -function makeK(param) { - return { - TAG: "K", - _0: [ - { - TAG: "Int", - _0: 5 - }, - { - TAG: "Int", - _0: 3 - } - ] - }; -} - -function testBoxedBinary(param) { - return 34; -} - -function testUnboxedBinary(param) { - return 34; -} - -function testInline(x) { - switch (x.TAG) { - case "I" : - return { - TAG: "I", - i: x.i, - j: x.j - }; - case "J" : - return x; - case "K" : - return { - TAG: "K", - _0: x._1, - _1: x._0 - }; - case "L" : - return { - TAG: "L", - _0: x._0 - }; - - } -} - -export { - makeVariant , - makeABC , - makeBC , - makeAC , - makeAD , - makeAE , - makeFD , - makeHD , - makeJ , - makeK , - testBoxedBinary , - testUnboxedBinary , - testInline , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/NonrecursiveTypes.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/NonrecursiveTypes.gen.tsx deleted file mode 100644 index 9842501a0a..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NonrecursiveTypes.gen.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* TypeScript file generated from NonrecursiveTypes.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type notRecursive = number; - -export type M_notRecursive = notRecursive[]; - -export type M_recursive = { readonly self: M_recursive }; - -export type M_mutualRecursive = { readonly a: M_a }; - -export type M_a = { readonly self: M_mutualRecursive }; diff --git a/jscomp/gentype_tests/typescript-react-example/src/NonrecursiveTypes.res.js b/jscomp/gentype_tests/typescript-react-example/src/NonrecursiveTypes.res.js deleted file mode 100644 index 44a5721747..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NonrecursiveTypes.res.js +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var M = {}; - -export { - M , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Null.res.js b/jscomp/gentype_tests/typescript-react-example/src/Null.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Null.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Nullable.res.js b/jscomp/gentype_tests/typescript-react-example/src/Nullable.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Nullable.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/NumericPolyVar.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/NumericPolyVar.gen.tsx deleted file mode 100644 index aa422e0c12..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NumericPolyVar.gen.tsx +++ /dev/null @@ -1,6 +0,0 @@ -/* TypeScript file generated from NumericPolyVar.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type t = 12 | 0 | "b"; diff --git a/jscomp/gentype_tests/typescript-react-example/src/NumericPolyVar.res.js b/jscomp/gentype_tests/typescript-react-example/src/NumericPolyVar.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/NumericPolyVar.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Object.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Object.gen.tsx deleted file mode 100644 index c8e3a51522..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Object.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from Object.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type someType = { readonly crop?: string; readonly "fp-z"?: string }; - -export type someType2 = { readonly crop: (undefined | string); readonly "fp-z": (undefined | string) }; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Object.res.js b/jscomp/gentype_tests/typescript-react-example/src/Object.res.js deleted file mode 100644 index e4b301d888..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Object.res.js +++ /dev/null @@ -1,18 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var st = { - crop: undefined, - "fp-z": undefined -}; - -var st2 = { - crop: undefined, - "fp-z": undefined -}; - -export { - st , - st2 , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/OnClick2.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/OnClick2.gen.tsx deleted file mode 100644 index 16b6cf3536..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/OnClick2.gen.tsx +++ /dev/null @@ -1,12 +0,0 @@ -/* TypeScript file generated from OnClick2.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as React from 'react'; - -import * as OnClick2JS from './OnClick2.res.js'; - -export type Props = { readonly onClick: (_1:MouseEvent) => void }; - -export const make: React.ComponentType<{ readonly onClick: (_1:MouseEvent) => void }> = OnClick2JS.make as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/OnClick2.res.js b/jscomp/gentype_tests/typescript-react-example/src/OnClick2.res.js deleted file mode 100644 index 61e88f26b1..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/OnClick2.res.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as React from "react"; - -function OnClick2(Props) { - var onClick = Props.onClick; - return React.createElement("div", { - onClick: onClick - }); -} - -var make = OnClick2; - -export { - make , -} -/* react Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Opaque.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Opaque.gen.tsx deleted file mode 100644 index 5b300724d5..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Opaque.gen.tsx +++ /dev/null @@ -1,16 +0,0 @@ -/* TypeScript file generated from Opaque.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as OpaqueJS from './Opaque.res.js'; - -import type {business as Records_business} from './Records.gen'; - -export abstract class opaqueFromRecords { protected opaque!: any }; /* simulate opaque types */ - -export type pair = [opaqueFromRecords, opaqueFromRecords]; - -export const noConversion: (x:opaqueFromRecords) => opaqueFromRecords = OpaqueJS.noConversion as any; - -export const testConvertNestedRecordFromOtherFile: (x:Records_business) => Records_business = OpaqueJS.testConvertNestedRecordFromOtherFile as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Opaque.res.js b/jscomp/gentype_tests/typescript-react-example/src/Opaque.res.js deleted file mode 100644 index 7639ea3f14..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Opaque.res.js +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function noConversion(x) { - return x; -} - -function testConvertNestedRecordFromOtherFile(x) { - return x; -} - -export { - noConversion , - testConvertNestedRecordFromOtherFile , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Promise.res.js b/jscomp/gentype_tests/typescript-react-example/src/Promise.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Promise.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Records.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Records.gen.tsx deleted file mode 100644 index f605dc6ec0..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Records.gen.tsx +++ /dev/null @@ -1,108 +0,0 @@ -/* TypeScript file generated from Records.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as RecordsJS from './Records.res.js'; - -import type {list} from '../src/shims/RescriptPervasives.shim'; - -export type coord = { - readonly x: number; - readonly y: number; - readonly z: (undefined | number) -}; - -export type person = { - readonly name: string; - readonly age: number; - readonly address: (undefined | string) -}; - -export type business = { - readonly name: string; - readonly owner: (undefined | person); - readonly address: (undefined | string) -}; - -export type payload = { readonly num: number; readonly payload: a }; - -export type record = { readonly v: number; readonly w: number }; - -export type business2 = { - readonly name: string; - readonly owner: (null | undefined | person); - readonly address2: (null | undefined | string) -}; - -export type mix = { - readonly a: number; - readonly b: number; - readonly c?: { - readonly name: string; - readonly surname: string - } -}; - -export type myRec = { readonly type: string }; - -export type myObj = { readonly type_: string }; - -export type myRecBsAs = { - readonly jsValid0: string; - readonly type: string; - readonly "the-key": string; - readonly "with\\\"dquote": string; - readonly "with'squote": string; - readonly "1number": string -}; - -export const origin: coord = RecordsJS.origin as any; - -export const computeArea: (param:coord) => number = RecordsJS.computeArea as any; - -export const coord2d: (x:number, y:number) => coord = RecordsJS.coord2d as any; - -export const findAddress: (business:business) => list = RecordsJS.findAddress as any; - -export const someBusiness: business = RecordsJS.someBusiness as any; - -export const findAllAddresses: (businesses:business[]) => string[] = RecordsJS.findAllAddresses as any; - -export const getPayload: (param:payload) => T1 = RecordsJS.getPayload as any; - -export const getPayloadRecord: (param:payload) => record = RecordsJS.getPayloadRecord as any; - -export const recordValue: record = RecordsJS.recordValue as any; - -export const payloadValue: payload = RecordsJS.payloadValue as any; - -export const getPayloadRecordPlusOne: (param:payload) => record = RecordsJS.getPayloadRecordPlusOne as any; - -export const findAddress2: (business:business2) => list = RecordsJS.findAddress2 as any; - -export const someBusiness2: business2 = RecordsJS.someBusiness2 as any; - -export const computeArea3: (o:{ - readonly x: number; - readonly y: number; - readonly z: (null | undefined | number) -}) => number = RecordsJS.computeArea3 as any; - -export const computeArea4: (o:{ - readonly x: number; - readonly y: number; - readonly z?: number -}) => number = RecordsJS.computeArea4 as any; - -export const testMyRec: (x:myRec) => string = RecordsJS.testMyRec as any; - -export const testMyRec2: (x:myRec) => myRec = RecordsJS.testMyRec2 as any; - -export const testMyObj: (x:myObj) => string = RecordsJS.testMyObj as any; - -export const testMyObj2: (x:myObj) => myObj = RecordsJS.testMyObj2 as any; - -export const testMyRecBsAs: (x:myRecBsAs) => string[] = RecordsJS.testMyRecBsAs as any; - -export const testMyRecBsAs2: (x:myRecBsAs) => myRecBsAs = RecordsJS.testMyRecBsAs2 as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js b/jscomp/gentype_tests/typescript-react-example/src/Records.res.js deleted file mode 100644 index f72740474c..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js +++ /dev/null @@ -1,175 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Belt_List from "rescript/lib/es6/belt_List.js"; -import * as Belt_Array from "rescript/lib/es6/belt_Array.js"; -import * as Belt_Option from "rescript/lib/es6/belt_Option.js"; -import * as Caml_option from "rescript/lib/es6/caml_option.js"; - -function computeArea(param) { - return Math.imul(Math.imul(param.x, param.y), Belt_Option.mapWithDefault(param.z, 1, (function (n) { - return n; - }))); -} - -function coord2d(x, y) { - return { - x: x, - y: y, - z: undefined - }; -} - -var getOpt = Belt_Option.mapWithDefault; - -function findAddress(business) { - return Belt_Option.mapWithDefault(business.address, /* [] */0, (function (a) { - return { - hd: a, - tl: /* [] */0 - }; - })); -} - -function findAllAddresses(businesses) { - return Belt_List.toArray(Belt_List.flatten(Belt_List.fromArray(Belt_Array.map(businesses, (function (business) { - return Belt_List.concat(Belt_Option.mapWithDefault(business.address, /* [] */0, (function (a) { - return { - hd: a, - tl: /* [] */0 - }; - })), Belt_Option.mapWithDefault(business.owner, /* [] */0, (function (p) { - return Belt_Option.mapWithDefault(p.address, /* [] */0, (function (a) { - return { - hd: a, - tl: /* [] */0 - }; - })); - }))); - }))))); -} - -function getPayload(param) { - return param.payload; -} - -function getPayloadRecord(param) { - return param.payload; -} - -var recordValue = { - v: 1, - w: 1 -}; - -var payloadValue = { - num: 1, - payload: recordValue -}; - -function getPayloadRecordPlusOne(param) { - var payload = param.payload; - return { - v: payload.v + 1 | 0, - w: payload.w - }; -} - -function findAddress2(business) { - return Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(business.address2), /* [] */0, (function (a) { - return { - hd: a, - tl: /* [] */0 - }; - })); -} - -var someBusiness2_owner = null; - -var someBusiness2_address2 = null; - -var someBusiness2 = { - name: "SomeBusiness", - owner: someBusiness2_owner, - address2: someBusiness2_address2 -}; - -function computeArea3(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(o.z), 1, (function (n) { - return n; - }))); -} - -function computeArea4(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(o.z, 1, (function (n) { - return n; - }))); -} - -function testMyRec(x) { - return x.type; -} - -function testMyRec2(x) { - return x; -} - -function testMyObj(x) { - return x.type_; -} - -function testMyObj2(x) { - return x; -} - -function testMyRecBsAs(x) { - return [ - x.jsValid0, - x.type, - x["the-key"], - x["with\\\"dquote"], - x["with'squote"], - x["1number"] - ]; -} - -function testMyRecBsAs2(x) { - return x; -} - -var origin = { - x: 0, - y: 0, - z: 0 -}; - -var someBusiness = { - name: "SomeBusiness", - owner: undefined, - address: undefined -}; - -export { - origin , - computeArea , - coord2d , - getOpt , - findAddress , - someBusiness , - findAllAddresses , - getPayload , - getPayloadRecord , - recordValue , - payloadValue , - getPayloadRecordPlusOne , - findAddress2 , - someBusiness2 , - computeArea3 , - computeArea4 , - testMyRec , - testMyRec2 , - testMyObj , - testMyObj2 , - testMyRecBsAs , - testMyRecBsAs2 , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/References.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/References.gen.tsx deleted file mode 100644 index ff722ab93d..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/References.gen.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/* TypeScript file generated from References.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as ReferencesJS from './References.res.js'; - -export abstract class R_t { protected opaque!: a }; /* simulate opaque types */ - -export type t = R_t; - -export type requiresConversion = { readonly x: number }; - -export const create: (x:number) => { contents: number } = ReferencesJS.create as any; - -export const access: (r:{ contents: number }) => number = ReferencesJS.access as any; - -export const update: (r:{ contents: number }) => void = ReferencesJS.update as any; - -export const get: (_1:R_t) => T1 = ReferencesJS.get as any; - -export const make: (_1:T1) => R_t = ReferencesJS.make as any; - -export const set: (_1:R_t, _2:T1) => void = ReferencesJS.set as any; - -export const destroysRefIdentity: (x:{ contents: requiresConversion }) => { contents: requiresConversion } = ReferencesJS.destroysRefIdentity as any; - -export const preserveRefIdentity: (x:R_t) => R_t = ReferencesJS.preserveRefIdentity as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/References.res.js b/jscomp/gentype_tests/typescript-react-example/src/References.res.js deleted file mode 100644 index b0b4088d58..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/References.res.js +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function create(x) { - return { - contents: x - }; -} - -function access(r) { - return r.contents + 1 | 0; -} - -function update(r) { - r.contents = r.contents + 1 | 0; -} - -function get(r) { - return r.contents; -} - -function make(prim) { - return { - contents: prim - }; -} - -function set(r, v) { - r.contents = v; -} - -var R = { - get: get, - make: make, - set: set -}; - -function destroysRefIdentity(x) { - return x; -} - -function preserveRefIdentity(x) { - return x; -} - -export { - create , - access , - update , - R , - get , - make , - set , - destroysRefIdentity , - preserveRefIdentity , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/RegExp.res.js b/jscomp/gentype_tests/typescript-react-example/src/RegExp.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/RegExp.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/RequireCond.res.js b/jscomp/gentype_tests/typescript-react-example/src/RequireCond.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/RequireCond.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Set_.res.js b/jscomp/gentype_tests/typescript-react-example/src/Set_.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Set_.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Shadow.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Shadow.gen.tsx deleted file mode 100644 index 4684ffd311..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Shadow.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from Shadow.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as ShadowJS from './Shadow.res.js'; - -export const test: () => string = ShadowJS.test as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Shadow.res.js b/jscomp/gentype_tests/typescript-react-example/src/Shadow.res.js deleted file mode 100644 index 87be066e3f..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Shadow.res.js +++ /dev/null @@ -1,20 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function test(param) { - return "a"; -} - -function test$1(param) { - return "a"; -} - -var M = { - test: test$1 -}; - -export { - test , - M , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestEmitInnerModules.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TestEmitInnerModules.gen.tsx deleted file mode 100644 index c90395cacb..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestEmitInnerModules.gen.tsx +++ /dev/null @@ -1,16 +0,0 @@ -/* TypeScript file generated from TestEmitInnerModules.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as TestEmitInnerModulesJS from './TestEmitInnerModules.res.js'; - -export const Inner_x: number = TestEmitInnerModulesJS.Inner.x as any; - -export const Inner_y: string = TestEmitInnerModulesJS.Inner.y as any; - -export const Outer_Medium_Inner_y: number = TestEmitInnerModulesJS.Outer.Medium.Inner.y as any; - -export const Inner: { x: number; y: string } = TestEmitInnerModulesJS.Inner as any; - -export const Outer: { Medium: { Inner: { y: number } } } = TestEmitInnerModulesJS.Outer as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestEmitInnerModules.res.js b/jscomp/gentype_tests/typescript-react-example/src/TestEmitInnerModules.res.js deleted file mode 100644 index 995314b4f9..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestEmitInnerModules.res.js +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var Inner = { - x: 34, - y: "hello" -}; - -var Inner$1 = { - y: 44 -}; - -var Medium = { - Inner: Inner$1 -}; - -var Outer = { - Medium: Medium -}; - -export { - Inner , - Outer , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestFirstClassModules.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TestFirstClassModules.gen.tsx deleted file mode 100644 index ee7c318a68..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestFirstClassModules.gen.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/* TypeScript file generated from TestFirstClassModules.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as TestFirstClassModulesJS from './TestFirstClassModules.res.js'; - -import type {firstClassModule as FirstClassModulesInterface_firstClassModule} from './FirstClassModulesInterface.gen'; - -import type {firstClassModule as FirstClassModules_firstClassModule} from './FirstClassModules.gen'; - -import type {record as FirstClassModulesInterface_record} from './FirstClassModulesInterface.gen'; - -export type firstClassModuleWithTypeEquations = { readonly out: (_1:o) => o; readonly Inner: { readonly inn: (_1:i) => i } }; - -export const convert: (x:FirstClassModules_firstClassModule) => FirstClassModules_firstClassModule = TestFirstClassModulesJS.convert as any; - -export const convertInterface: (x:FirstClassModulesInterface_firstClassModule) => FirstClassModulesInterface_firstClassModule = TestFirstClassModulesJS.convertInterface as any; - -export const convertRecord: (x:FirstClassModulesInterface_record) => FirstClassModulesInterface_record = TestFirstClassModulesJS.convertRecord as any; - -export const convertFirstClassModuleWithTypeEquations: (x:{ readonly out: ((_1:T1) => T1); readonly Inner: { readonly inn: ((_1:T2) => T2) } }) => { readonly out: (_1:T1) => T1; readonly Inner: { readonly inn: (_1:T2) => T2 } } = TestFirstClassModulesJS.convertFirstClassModuleWithTypeEquations as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestFirstClassModules.res.js b/jscomp/gentype_tests/typescript-react-example/src/TestFirstClassModules.res.js deleted file mode 100644 index bef4b0e21b..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestFirstClassModules.res.js +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function convert(x) { - return x; -} - -function convertInterface(x) { - return x; -} - -function convertRecord(x) { - return x; -} - -function convertFirstClassModuleWithTypeEquations(x) { - return x; -} - -export { - convert , - convertInterface , - convertRecord , - convertFirstClassModuleWithTypeEquations , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestImmutableArray.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TestImmutableArray.gen.tsx deleted file mode 100644 index 9037ddbe33..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestImmutableArray.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from TestImmutableArray.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as TestImmutableArrayJS from './TestImmutableArray.res.js'; - -export const testImmutableArrayGet: (arr:ReadonlyArray) => (undefined | T1) = TestImmutableArrayJS.testImmutableArrayGet as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestImmutableArray.res.js b/jscomp/gentype_tests/typescript-react-example/src/TestImmutableArray.res.js deleted file mode 100644 index 4cba8d864a..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestImmutableArray.res.js +++ /dev/null @@ -1,23 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Belt_Array from "rescript/lib/es6/belt_Array.js"; -import * as ImmutableArray from "./ImmutableArray.res.js"; - -function testImmutableArrayGet(arr) { - return ImmutableArray.$$Array.get(arr, 3); -} - -function testBeltArrayGet(arr) { - return Belt_Array.get(arr, 3); -} - -function testBeltArraySet(arr) { - return Belt_Array.set(arr, 3, 4); -} - -export { - testImmutableArrayGet , - testBeltArrayGet , - testBeltArraySet , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestModuleAliases.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TestModuleAliases.gen.tsx deleted file mode 100644 index fa6bcf0133..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestModuleAliases.gen.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/* TypeScript file generated from TestModuleAliases.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as TestModuleAliasesJS from './TestModuleAliases.res.js'; - -import type {InnerAlias_inner as ModuleAliases2_InnerAlias_inner} from './ModuleAliases2.gen'; - -import type {Outer_Inner_inner as ModuleAliases2_Outer_Inner_inner} from './ModuleAliases2.gen'; - -import type {Outer_outer as ModuleAliases2_Outer_outer} from './ModuleAliases2.gen'; - -import type {record as ModuleAliases2_record} from './ModuleAliases2.gen'; - -export type OtherFile_record = { readonly x: number; readonly y: string }; - -export type record = ModuleAliases2_record; - -export type record2 = ModuleAliases2_record; - -export type outer = ModuleAliases2_Outer_outer; - -export type outer2 = ModuleAliases2_Outer_outer; - -export type my2 = ModuleAliases2_Outer_Inner_inner; - -export type inner1 = ModuleAliases2_InnerAlias_inner; - -export type inner2 = ModuleAliases2_Outer_Inner_inner; - -export const testInner1: (x:inner1) => inner1 = TestModuleAliasesJS.testInner1 as any; - -export const testInner1Expanded: (x:ModuleAliases2_InnerAlias_inner) => ModuleAliases2_InnerAlias_inner = TestModuleAliasesJS.testInner1Expanded as any; - -export const testInner2: (x:inner2) => inner2 = TestModuleAliasesJS.testInner2 as any; - -export const testInner2Expanded: (x:ModuleAliases2_Outer_Inner_inner) => ModuleAliases2_Outer_Inner_inner = TestModuleAliasesJS.testInner2Expanded as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestModuleAliases.res.js b/jscomp/gentype_tests/typescript-react-example/src/TestModuleAliases.res.js deleted file mode 100644 index cde0007a68..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestModuleAliases.res.js +++ /dev/null @@ -1,44 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function testInner1(x) { - return x; -} - -function testInner1Expanded(x) { - return x; -} - -function testInner2(x) { - return x; -} - -function testInner2Expanded(x) { - return x; -} - -var OtherFile; - -var OtherFileAlias; - -var OuterAlias; - -var OtherFile1; - -var Outer2; - -var Inner2; - -export { - OtherFile , - OtherFileAlias , - OuterAlias , - OtherFile1 , - Outer2 , - Inner2 , - testInner1 , - testInner1Expanded , - testInner2 , - testInner2Expanded , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.gen.tsx deleted file mode 100644 index 04f5f47e9f..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.gen.tsx +++ /dev/null @@ -1,16 +0,0 @@ -/* TypeScript file generated from TestPromise.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as TestPromiseJS from './TestPromise.res.js'; - -export type promise = Promise; - -export type fromPayload = { readonly x: number; readonly s: string }; - -export type toPayload = { readonly result: string }; - -export const convert: (_1:Promise) => Promise = TestPromiseJS.convert as any; - -export const barx: (x:(undefined | Promise<(undefined | string)>), _2:void) => boolean = TestPromiseJS.barx as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js deleted file mode 100644 index 69f21a758c..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js +++ /dev/null @@ -1,24 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Caml_obj from "rescript/lib/es6/caml_obj.js"; -import * as Js_promise from "rescript/lib/es6/js_promise.js"; -import * as Caml_option from "rescript/lib/es6/caml_option.js"; - -function convert(param) { - return Js_promise.then_((function (param) { - return Promise.resolve({ - result: param.s - }); - }), param); -} - -function barx(xOpt, param) { - var x = xOpt !== undefined ? Caml_option.valFromOption(xOpt) : Promise.resolve("a"); - return Caml_obj.equal(x, x); -} - -export { - convert , - barx , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType1.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TransitiveType1.gen.tsx deleted file mode 100644 index 71698f9c87..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType1.gen.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* TypeScript file generated from TransitiveType1.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as TransitiveType1JS from './TransitiveType1.res.js'; - -import type {t2Alias as TransitiveType2_t2Alias} from './TransitiveType2.gen'; - -import type {t2 as TransitiveType2_t2} from './TransitiveType2.gen'; - -export const convert: (x:TransitiveType2_t2) => TransitiveType2_t2 = TransitiveType1JS.convert as any; - -export const convertAlias: (x:TransitiveType2_t2Alias) => TransitiveType2_t2Alias = TransitiveType1JS.convertAlias as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType1.res.js b/jscomp/gentype_tests/typescript-react-example/src/TransitiveType1.res.js deleted file mode 100644 index 5fda66bee8..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType1.res.js +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function convert(x) { - return x; -} - -function convertAlias(x) { - return x; -} - -export { - convert , - convertAlias , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType2.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TransitiveType2.gen.tsx deleted file mode 100644 index 02c9548b3a..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType2.gen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* TypeScript file generated from TransitiveType2.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import type {t3 as TransitiveType3_t3} from './TransitiveType3.gen'; - -export type t2 = (undefined | TransitiveType3_t3); - -export type t2Alias = t2; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType2.res.js b/jscomp/gentype_tests/typescript-react-example/src/TransitiveType2.res.js deleted file mode 100644 index cf62be6e01..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType2.res.js +++ /dev/null @@ -1,11 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function convertT2(x) { - return x; -} - -export { - convertT2 , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType3.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TransitiveType3.gen.tsx deleted file mode 100644 index 9fa08f9bdc..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType3.gen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* TypeScript file generated from TransitiveType3.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as TransitiveType3JS from './TransitiveType3.res.js'; - -export type t3 = { readonly i: number; readonly s: string }; - -export const convertT3: (x:t3) => t3 = TransitiveType3JS.convertT3 as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType3.res.js b/jscomp/gentype_tests/typescript-react-example/src/TransitiveType3.res.js deleted file mode 100644 index 77e8c2ac24..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TransitiveType3.res.js +++ /dev/null @@ -1,11 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function convertT3(x) { - return x; -} - -export { - convertT3 , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TypeNameSanitize.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TypeNameSanitize.gen.tsx deleted file mode 100644 index 1d8672b5e4..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TypeNameSanitize.gen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* TypeScript file generated from TypeNameSanitize.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type t_ = number; - -export type M_t__ = number; - -export type pair = [t_, M_t__]; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TypeNameSanitize.res.js b/jscomp/gentype_tests/typescript-react-example/src/TypeNameSanitize.res.js deleted file mode 100644 index 44a5721747..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TypeNameSanitize.res.js +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var M = {}; - -export { - M , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TypeParams1.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TypeParams1.gen.tsx deleted file mode 100644 index 9ec2bad966..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TypeParams1.gen.tsx +++ /dev/null @@ -1,6 +0,0 @@ -/* TypeScript file generated from TypeParams1.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type ocaml_array = a[]; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TypeParams1.res.js b/jscomp/gentype_tests/typescript-react-example/src/TypeParams1.res.js deleted file mode 100644 index 99313ed03f..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TypeParams1.res.js +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var exportSomething = 10; - -export { - exportSomething , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TypeParams2.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TypeParams2.gen.tsx deleted file mode 100644 index bef46e020b..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TypeParams2.gen.tsx +++ /dev/null @@ -1,12 +0,0 @@ -/* TypeScript file generated from TypeParams2.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import type {ocaml_array as TypeParams1_ocaml_array} from './TypeParams1.gen'; - -export type item = { readonly id: number }; - -export type items = TypeParams1_ocaml_array; - -export type items2 = item[]; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TypeParams2.res.js b/jscomp/gentype_tests/typescript-react-example/src/TypeParams2.res.js deleted file mode 100644 index 99313ed03f..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TypeParams2.res.js +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var exportSomething = 10; - -export { - exportSomething , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/TypeParams3.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/TypeParams3.gen.tsx deleted file mode 100644 index 25d8ac0cb5..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TypeParams3.gen.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* TypeScript file generated from TypeParams3.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as TypeParams3JS from './TypeParams3.res.js'; - -import type {items2 as TypeParams2_items2} from './TypeParams2.gen'; - -import type {items as TypeParams2_items} from './TypeParams2.gen'; - -export const test: (x:TypeParams2_items) => TypeParams2_items = TypeParams3JS.test as any; - -export const test2: (x:TypeParams2_items2) => TypeParams2_items2 = TypeParams3JS.test2 as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/TypeParams3.res.js b/jscomp/gentype_tests/typescript-react-example/src/TypeParams3.res.js deleted file mode 100644 index 26ba896205..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/TypeParams3.res.js +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function test(x) { - return x; -} - -function test2(x) { - return x; -} - -export { - test , - test2 , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Unboxed.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Unboxed.gen.tsx deleted file mode 100644 index 43d5469d46..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Unboxed.gen.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/* TypeScript file generated from Unboxed.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as UnboxedJS from './Unboxed.res.js'; - -export type v1 = number; - -export type v2 = number; - -export type r1 = number; - -export type r2 = string; - -export type t = number[] | number | ((_1:number) => number); - -export type tabIndex = "0" | "1" | 0; - -export const testV1: (x:v1) => v1 = UnboxedJS.testV1 as any; - -export const r2Test: (x:r2) => r2 = UnboxedJS.r2Test as any; - -export const a: tabIndex = UnboxedJS.a as any; - -export const b: tabIndex = UnboxedJS.b as any; - -export const zero: 0 = UnboxedJS.zero as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Unboxed.res.js b/jscomp/gentype_tests/typescript-react-example/src/Unboxed.res.js deleted file mode 100644 index 7c02bf0833..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Unboxed.res.js +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function testV1(x) { - return x; -} - -function r2Test(x) { - return x; -} - -var a = "0"; - -var b = "1"; - -var zero = 0; - -export { - testV1 , - r2Test , - a , - b , - zero , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Uncurried.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Uncurried.gen.tsx deleted file mode 100644 index c9df733f62..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Uncurried.gen.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/* TypeScript file generated from Uncurried.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as UncurriedJS from './Uncurried.res.js'; - -export type u0 = () => string; - -export type u1 = (_1:number) => string; - -export type u2 = (_1:number, _2:string) => string; - -export type u3 = (_1:number, _2:string, _3:number) => string; - -export type auth = { readonly login: () => string }; - -export type authU = { readonly loginU: () => string }; - -export const uncurried0: () => string = UncurriedJS.uncurried0 as any; - -export const uncurried1: (x:number) => string = UncurriedJS.uncurried1 as any; - -export const uncurried2: (x:number, y:string) => string = UncurriedJS.uncurried2 as any; - -export const uncurried3: (x:number, y:string, z:number) => string = UncurriedJS.uncurried3 as any; - -export const curried3: (x:number, y:string, z:number) => string = UncurriedJS.curried3 as any; - -export const callback: (cb:(() => number)) => string = UncurriedJS.callback as any; - -export const callback2: (auth:auth) => string = UncurriedJS.callback2 as any; - -export const callback2U: (auth:authU) => string = UncurriedJS.callback2U as any; - -export const sumU: (n:number, m:number) => void = UncurriedJS.sumU as any; - -export const sumU2: (n:number) => (_1:number) => void = UncurriedJS.sumU2 as any; - -export const sumCurried: (n:number, _2:number) => void = UncurriedJS.sumCurried as any; - -export const sumLblCurried: (s:string, n:number, m:number) => void = UncurriedJS.sumLblCurried as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js b/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js deleted file mode 100644 index 5878196f58..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Curry from "rescript/lib/es6/curry.js"; - -function uncurried0() { - return ""; -} - -function uncurried1(x) { - return String(x); -} - -function uncurried2(x, y) { - return String(x) + y; -} - -function uncurried3(x, y, z) { - return String(x) + (y + String(z)); -} - -function curried3(x, y, z) { - return String(x) + (y + String(z)); -} - -function callback(cb) { - return String(Curry._1(cb, undefined)); -} - -function callback2(auth) { - return Curry._1(auth.login, undefined); -} - -function callback2U(auth) { - return auth.loginU(); -} - -function sumU(n, m) { - console.log("sumU 2nd arg", m, "result", n + m | 0); -} - -function sumU2(n) { - return function (m) { - console.log("sumU2 2nd arg", m, "result", n + m | 0); - }; -} - -function sumCurried(n) { - console.log("sumCurried 1st arg", n); - return function (m) { - console.log("sumCurried 2nd arg", m, "result", n + m | 0); - }; -} - -function sumLblCurried(s, n) { - console.log(s, "sumLblCurried 1st arg", n); - return function (m) { - console.log("sumLblCurried 2nd arg", m, "result", n + m | 0); - }; -} - -export { - uncurried0 , - uncurried1 , - uncurried2 , - uncurried3 , - curried3 , - callback , - callback2 , - callback2U , - sumU , - sumU2 , - sumCurried , - sumLblCurried , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Undefined.res.js b/jscomp/gentype_tests/typescript-react-example/src/Undefined.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Undefined.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Usage.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Usage.gen.tsx deleted file mode 100644 index 551e6df22a..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Usage.gen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* TypeScript file generated from Usage.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as UsageJS from './Usage.res.js'; - -import type {MyModuleAlias_t as Wrapper_MyModuleAlias_t} from './Wrapper.gen'; - -export const b: Wrapper_MyModuleAlias_t = UsageJS.b as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Usage.res.js b/jscomp/gentype_tests/typescript-react-example/src/Usage.res.js deleted file mode 100644 index 602ee55bcb..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Usage.res.js +++ /dev/null @@ -1,13 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as MyModule from "./MyModule.res.js"; - -var b = MyModule.add(5, 3); - -var a = 5; - -export { - a , - b , -} -/* b Not a pure module */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/UseImportJsValue.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/UseImportJsValue.gen.tsx deleted file mode 100644 index 0fad6f2076..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/UseImportJsValue.gen.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* TypeScript file generated from UseImportJsValue.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as UseImportJsValueJS from './UseImportJsValue.res.js'; - -import type {AbsoluteValue_t as ImportJsValue_AbsoluteValue_t} from './ImportJsValue.gen'; - -import type {stringFunction as ImportJsValue_stringFunction} from './ImportJsValue.gen'; - -export const useGetProp: (x:ImportJsValue_AbsoluteValue_t) => number = UseImportJsValueJS.useGetProp as any; - -export const useTypeImportedInOtherModule: (x:ImportJsValue_stringFunction) => ImportJsValue_stringFunction = UseImportJsValueJS.useTypeImportedInOtherModule as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/UseImportJsValue.res.js b/jscomp/gentype_tests/typescript-react-example/src/UseImportJsValue.res.js deleted file mode 100644 index c954b150e0..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/UseImportJsValue.res.js +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function useGetProp(x) { - return x.getProp() + 1 | 0; -} - -function useTypeImportedInOtherModule(x) { - return x; -} - -export { - useGetProp , - useTypeImportedInOtherModule , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/V3Compatibility.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/V3Compatibility.gen.tsx deleted file mode 100644 index 2b55a93c66..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/V3Compatibility.gen.tsx +++ /dev/null @@ -1,6 +0,0 @@ -/* TypeScript file generated from V3Compatibility.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -export type cb = (_1:number) => string; diff --git a/jscomp/gentype_tests/typescript-react-example/src/V3Compatibility.res.js b/jscomp/gentype_tests/typescript-react-example/src/V3Compatibility.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/V3Compatibility.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Variants.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Variants.gen.tsx deleted file mode 100644 index 3b2b65d60d..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Variants.gen.tsx +++ /dev/null @@ -1,84 +0,0 @@ -/* TypeScript file generated from Variants.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as VariantsJS from './Variants.res.js'; - -import type {list} from '../src/shims/RescriptPervasives.shim'; - -export type weekday = - "monday" - | "tuesday" - | "wednesday" - | "thursday" - | "friday" - | "saturday" - | "sunday"; - -export type testGenTypeAs = "type_" | "module_" | "fortytwo"; - -export type testGenTypeAs2 = "type_" | "module" | 42; - -export type testGenTypeAs3 = "type_" | "module" | 42; - -export type x1 = "x" | "x1"; - -export type x2 = "x" | "x2"; - -export type type_ = "Type"; -export type type = type_; - -export type myList = "E" | { TAG: "C"; _0: number; _1: myList }; - -export type builtinList = list; - -export type result1 = - { TAG: "Ok"; _0: a } - | { TAG: "Error"; _0: b }; - -export type result2 = - { TAG: "Ok"; _0: a } - | { TAG: "Error"; _0: b }; - -export type result3 = - { TAG: "Ok"; _0: a } - | { TAG: "Error"; _0: b }; - -export const isWeekend: (x:weekday) => boolean = VariantsJS.isWeekend as any; - -export const monday: "monday" = VariantsJS.monday as any; - -export const saturday: "saturday" = VariantsJS.saturday as any; - -export const sunday: "sunday" = VariantsJS.sunday as any; - -export const onlySunday: (param:"sunday") => void = VariantsJS.onlySunday as any; - -export const swap: (x:"saturday" | "sunday") => "saturday" | "sunday" = VariantsJS.swap as any; - -export const testConvert: (x:testGenTypeAs) => testGenTypeAs = VariantsJS.testConvert as any; - -export const fortytwoOK: testGenTypeAs = VariantsJS.fortytwoOK as any; - -export const fortytwoBAD: "fortytwo" = VariantsJS.fortytwoBAD as any; - -export const testConvert2: (x:testGenTypeAs2) => testGenTypeAs2 = VariantsJS.testConvert2 as any; - -export const testConvert3: (x:testGenTypeAs3) => testGenTypeAs3 = VariantsJS.testConvert3 as any; - -export const testConvert2to3: (x:testGenTypeAs2) => testGenTypeAs3 = VariantsJS.testConvert2to3 as any; - -export const id1: (x:x1) => x1 = VariantsJS.id1 as any; - -export const id2: (x:x2) => x2 = VariantsJS.id2 as any; - -export const polyWithOpt: (foo:string) => (undefined | ( - { NAME: "One"; VAL: string } - | { NAME: "Two"; VAL: number })) = VariantsJS.polyWithOpt as any; - -export const restResult1: (x:result1) => result1 = VariantsJS.restResult1 as any; - -export const restResult2: (x:result2) => result2 = VariantsJS.restResult2 as any; - -export const restResult3: (x:result3) => result3 = VariantsJS.restResult3 as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Variants.res.js b/jscomp/gentype_tests/typescript-react-example/src/Variants.res.js deleted file mode 100644 index 9f7f047d42..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Variants.res.js +++ /dev/null @@ -1,106 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function isWeekend(x) { - if (x === "sunday") { - return true; - } else { - return x === "saturday"; - } -} - -function onlySunday(param) { - -} - -function swap(x) { - if (x === "sunday") { - return "saturday"; - } else { - return "sunday"; - } -} - -function testConvert(x) { - return x; -} - -function testConvert2(x) { - return x; -} - -function testConvert3(x) { - return x; -} - -function testConvert2to3(x) { - return x; -} - -function id1(x) { - return x; -} - -function id2(x) { - return x; -} - -function polyWithOpt(foo) { - if (foo === "bar") { - return ; - } else if (foo !== "baz") { - return { - NAME: "One", - VAL: foo - }; - } else { - return { - NAME: "Two", - VAL: 1 - }; - } -} - -function restResult1(x) { - return x; -} - -function restResult2(x) { - return x; -} - -function restResult3(x) { - return x; -} - -var monday = "monday"; - -var saturday = "saturday"; - -var sunday = "sunday"; - -var fortytwoOK = "fortytwo"; - -var fortytwoBAD = "fortytwo"; - -export { - isWeekend , - monday , - saturday , - sunday , - onlySunday , - swap , - testConvert , - fortytwoOK , - fortytwoBAD , - testConvert2 , - testConvert3 , - testConvert2to3 , - id1 , - id2 , - polyWithOpt , - restResult1 , - restResult2 , - restResult3 , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.gen.tsx deleted file mode 100644 index 4cb3a20bac..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.gen.tsx +++ /dev/null @@ -1,52 +0,0 @@ -/* TypeScript file generated from VariantsWithPayload.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as VariantsWithPayloadJS from './VariantsWithPayload.res.js'; - -export type payload = { readonly x: number; readonly y?: string }; - -export type withPayload = - "a" - | "b" - | "True" - | "Twenty" - | "Half" - | { NAME: "c"; VAL: payload }; - -export type manyPayloads = - { NAME: "one"; VAL: number } - | { NAME: "two"; VAL: [string, string] } - | { NAME: "three"; VAL: payload }; - -export type simpleVariant = "A" | "B" | "C"; - -export type variantWithPayloads = - "A" - | { TAG: "B"; _0: number } - | { TAG: "C"; _0: number; _1: number } - | { TAG: "D"; _0: number; _1: number } - | { TAG: "E"; _0: number; _1: string; _2: number }; - -export type variant1Int = { TAG: "R"; _0: number }; - -export type variant1Object = { TAG: "R"; _0: payload }; - -export const testWithPayload: (x:withPayload) => withPayload = VariantsWithPayloadJS.testWithPayload as any; - -export const printVariantWithPayload: (x:withPayload) => void = VariantsWithPayloadJS.printVariantWithPayload as any; - -export const testManyPayloads: (x:manyPayloads) => manyPayloads = VariantsWithPayloadJS.testManyPayloads as any; - -export const printManyPayloads: (x:manyPayloads) => void = VariantsWithPayloadJS.printManyPayloads as any; - -export const testSimpleVariant: (x:simpleVariant) => simpleVariant = VariantsWithPayloadJS.testSimpleVariant as any; - -export const testVariantWithPayloads: (x:variantWithPayloads) => variantWithPayloads = VariantsWithPayloadJS.testVariantWithPayloads as any; - -export const printVariantWithPayloads: (x:variantWithPayloads) => void = VariantsWithPayloadJS.printVariantWithPayloads as any; - -export const testVariant1Int: (x:variant1Int) => variant1Int = VariantsWithPayloadJS.testVariant1Int as any; - -export const testVariant1Object: (x:variant1Object) => variant1Object = VariantsWithPayloadJS.testVariant1Object as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.res.js b/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.res.js deleted file mode 100644 index b1bd1018b8..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.res.js +++ /dev/null @@ -1,96 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -function testWithPayload(x) { - return x; -} - -function printVariantWithPayload(x) { - if (typeof x !== "object") { - if (x === "a") { - console.log("printVariantWithPayload: a"); - } else if (x === "b") { - console.log("printVariantWithPayload: b"); - } else if (x === "Half") { - console.log("printVariantWithPayload: Half"); - } else if (x === "True") { - console.log("printVariantWithPayload: True"); - } else { - console.log("printVariantWithPayload: Twenty"); - } - return ; - } - var payload = x.VAL; - console.log("printVariantWithPayload x:", payload.x, "y:", payload.y); -} - -function testManyPayloads(x) { - return x; -} - -function printManyPayloads(x) { - var variant = x.NAME; - if (variant === "two") { - var match = x.VAL; - console.log("printManyPayloads two:", match[0], match[1]); - return ; - } - if (variant === "three") { - var payload = x.VAL; - console.log("printManyPayloads x:", payload.x, "y:", payload.y); - return ; - } - console.log("printManyPayloads one:", x.VAL); -} - -function testSimpleVariant(x) { - return x; -} - -function testVariantWithPayloads(x) { - return x; -} - -function printVariantWithPayloads(x) { - if (typeof x !== "object") { - console.log("printVariantWithPayloads", "A"); - return ; - } - switch (x.TAG) { - case "B" : - console.log("printVariantWithPayloads", "B(" + (String(x._0) + ")")); - return ; - case "C" : - console.log("printVariantWithPayloads", "C(" + (String(x._0) + (", " + (String(x._1) + ")")))); - return ; - case "D" : - var match = x._0; - console.log("printVariantWithPayloads", "D((" + (String(match[0]) + (", " + (String(match[1]) + "))")))); - return ; - case "E" : - console.log("printVariantWithPayloads", "E(" + (String(x._0) + (", " + (x._1 + (", " + (String(x._2) + ")")))))); - return ; - - } -} - -function testVariant1Int(x) { - return x; -} - -function testVariant1Object(x) { - return x; -} - -export { - testWithPayload , - printVariantWithPayload , - testManyPayloads , - printManyPayloads , - testSimpleVariant , - testVariantWithPayloads , - printVariantWithPayloads , - testVariant1Int , - testVariant1Object , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Warnings.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Warnings.gen.tsx deleted file mode 100644 index 9fd5e1d214..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Warnings.gen.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* TypeScript file generated from Warnings.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as WarningsJS from './Warnings.res.js'; - -export const ddd: number = WarningsJS.x as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Warnings.res.js b/jscomp/gentype_tests/typescript-react-example/src/Warnings.res.js deleted file mode 100644 index 85e08c2ae4..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Warnings.res.js +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var x = 42; - -export { - x , -} -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/WeakMap.res.js b/jscomp/gentype_tests/typescript-react-example/src/WeakMap.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/WeakMap.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/WeakSet.res.js b/jscomp/gentype_tests/typescript-react-example/src/WeakSet.res.js deleted file mode 100644 index d856702bfe..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/WeakSet.res.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/Wrapper.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/Wrapper.gen.tsx deleted file mode 100644 index d2baeb44c7..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Wrapper.gen.tsx +++ /dev/null @@ -1,12 +0,0 @@ -/* TypeScript file generated from Wrapper.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as WrapperJS from './Wrapper.res.js'; - -export type MyModuleAlias_t = number; - -export const MyModuleAlias_add: (_1:MyModuleAlias_t, _2:MyModuleAlias_t) => MyModuleAlias_t = WrapperJS.MyModuleAlias.add as any; - -export const MyModuleAlias: { add: (_1:MyModuleAlias_t, _2:MyModuleAlias_t) => MyModuleAlias_t } = WrapperJS.MyModuleAlias as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Wrapper.res.js b/jscomp/gentype_tests/typescript-react-example/src/Wrapper.res.js deleted file mode 100644 index e49a9a2be3..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/Wrapper.res.js +++ /dev/null @@ -1,8 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - - -let v = 3; - -exports.v = v; -/* No side effect */ diff --git a/jscomp/gentype_tests/typescript-react-example/src/counter.gen.tsx b/jscomp/gentype_tests/typescript-react-example/src/counter.gen.tsx deleted file mode 100644 index 835e5cb896..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/counter.gen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/* TypeScript file generated from counter.res by genType. */ - -/* eslint-disable */ -/* tslint:disable */ - -import * as counterJS from './counter.res.js'; - -import type {aa as Machine_aa} from './Machine.gen'; - -export const b: Machine_aa = counterJS.b as any; diff --git a/jscomp/gentype_tests/typescript-react-example/src/counter.res.js b/jscomp/gentype_tests/typescript-react-example/src/counter.res.js deleted file mode 100644 index 10458c1307..0000000000 --- a/jscomp/gentype_tests/typescript-react-example/src/counter.res.js +++ /dev/null @@ -1,12 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - - -var b = { - TAG: "A", - _0: 12 -}; - -export { - b , -} -/* No side effect */ diff --git a/jscomp/ounit_tests/ounit_cmd_util.ml b/jscomp/ounit_tests/ounit_cmd_util.ml index 9c0faa2476..e0bdfa6be3 100644 --- a/jscomp/ounit_tests/ounit_cmd_util.ml +++ b/jscomp/ounit_tests/ounit_cmd_util.ml @@ -2,7 +2,7 @@ let (//) = Filename.concat (** may nonterminate when [cwd] is '.' *) let rec unsafe_root_dir_aux cwd = - if Sys.file_exists (cwd//Literals.bsconfig_json) then cwd + if Sys.file_exists (cwd // Literals.rescript_json) then cwd else unsafe_root_dir_aux (Filename.dirname cwd) let project_root = unsafe_root_dir_aux (Sys.getcwd ()) diff --git a/rescript.json b/rescript.json new file mode 100644 index 0000000000..e6709ce447 --- /dev/null +++ b/rescript.json @@ -0,0 +1,6 @@ +{ + "sources": { + "dir": "jscomp/test", + "dev": true + } +}