From b1ec78b7640a6eb55e8d2eef31cdfe39f0d7e527 Mon Sep 17 00:00:00 2001 From: Milly Date: Sat, 24 Aug 2024 21:58:19 +0900 Subject: [PATCH] :+1: exports sub modules --- deno.jsonc | 8 ++++++++ eval/expression.ts | 12 +++++++++--- eval/string.ts | 12 +++++++++--- eval/stringify.ts | 9 ++++++++- eval/use_eval.ts | 13 ++++++++++--- 5 files changed, 44 insertions(+), 10 deletions(-) diff --git a/deno.jsonc b/deno.jsonc index edede985..497e1329 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -9,6 +9,10 @@ "./buffer": "./buffer/mod.ts", "./bufname": "./bufname/mod.ts", "./eval": "./eval/mod.ts", + "./eval/expression": "./eval/expression.ts", + "./eval/stringify": "./eval/stringify.ts", + "./eval/string": "./eval/string.ts", + "./eval/use-eval": "./eval/use_eval.ts", "./function": "./function/mod.ts", "./function/nvim": "./function/nvim/mod.ts", "./function/vim": "./function/vim/mod.ts", @@ -64,6 +68,10 @@ "jsr:@denops/std/buffer": "./buffer/mod.ts", "jsr:@denops/std/bufname": "./bufname/mod.ts", "jsr:@denops/std/eval": "./eval/mod.ts", + "jsr:@denops/std/eval/expression": "./eval/expression.ts", + "jsr:@denops/std/eval/stringify": "./eval/stringify.ts", + "jsr:@denops/std/eval/string": "./eval/string.ts", + "jsr:@denops/std/eval/use-eval": "./eval/use_eval.ts", "jsr:@denops/std/function": "./function/mod.ts", "jsr:@denops/std/function/nvim": "./function/nvim/mod.ts", "jsr:@denops/std/function/vim": "./function/vim/mod.ts", diff --git a/eval/expression.ts b/eval/expression.ts index 3ee0e562..d426d81b 100644 --- a/eval/expression.ts +++ b/eval/expression.ts @@ -1,3 +1,9 @@ +/** + * This module provides utilities for creating Vim expressions in TypeScript. + * + * @module + */ + import type { Predicate } from "@core/unknownutil/type"; import { isIntersectionOf } from "@core/unknownutil/is/intersection-of"; import { isLiteralOf } from "@core/unknownutil/is/literal-of"; @@ -17,7 +23,7 @@ import { stringify } from "./stringify.ts"; * * ```typescript * import { assertEquals } from "jsr:@std/assert/equals"; - * import { expr } from "jsr:@denops/std/eval"; + * import { expr } from "jsr:@denops/std/eval/expression"; * * const s: string = expr`foo`; * assertEquals(typeof s, "object"); // is not "string" @@ -49,7 +55,7 @@ interface ExpressionProps extends VimEvaluatable { * * ```typescript * import { assertEquals } from "jsr:@std/assert/equals"; - * import { expr } from "jsr:@denops/std/eval"; + * import { expr } from "jsr:@denops/std/eval/expression"; * * assertEquals( * expr`raw_vim_expression`.toString(), @@ -77,7 +83,7 @@ export function expr( * * ```typescript * import { assert, assertFalse } from "jsr:@std/assert"; - * import { isExpression, expr } from "jsr:@denops/std/eval"; + * import { isExpression, expr } from "jsr:@denops/std/eval/expression"; * * assert(isExpression(expr`123`)); * diff --git a/eval/string.ts b/eval/string.ts index 29d911e8..66b6393a 100644 --- a/eval/string.ts +++ b/eval/string.ts @@ -1,3 +1,9 @@ +/** + * This module provides utilities for creating Vim string in TypeScript. + * + * @module + */ + import type { Predicate } from "@core/unknownutil/type"; import { isIntersectionOf } from "@core/unknownutil/is/intersection-of"; import { isLiteralOf } from "@core/unknownutil/is/literal-of"; @@ -21,7 +27,7 @@ import { * * ```typescript * import { assertEquals } from "jsr:@std/assert/equals"; - * import { rawString } from "jsr:@denops/std/eval"; + * import { rawString } from "jsr:@denops/std/eval/string"; * * const s: string = rawString`foo`; * assertEquals(s.toString(), "foo"); @@ -76,7 +82,7 @@ interface RawStringProps extends VimEvaluatable { * * ```typescript * import { assertEquals } from "jsr:@std/assert/equals"; - * import { rawString } from "jsr:@denops/std/eval"; + * import { rawString } from "jsr:@denops/std/eval/string"; * * assertEquals( * rawString`foo`.toString(), @@ -108,7 +114,7 @@ export function rawString( * Returns `true` if the value is a {@linkcode RawString}. * * ```typescript - * import { isRawString, rawString } from "jsr:@denops/std/eval"; + * import { isRawString, rawString } from "jsr:@denops/std/eval/string"; * * isRawString(rawString`foo`); * // true diff --git a/eval/stringify.ts b/eval/stringify.ts index 20d113eb..6d6a821b 100644 --- a/eval/stringify.ts +++ b/eval/stringify.ts @@ -1,3 +1,9 @@ +/** + * This module provides the function to serialize JavaScript values into Vim values. + * + * @module + */ + import { isArray } from "@core/unknownutil/is/array"; import { isBoolean } from "@core/unknownutil/is/boolean"; import { isCustomJsonable } from "@core/unknownutil/is/custom-jsonable"; @@ -48,7 +54,8 @@ import { * * ```typescript * import type { Denops } from "jsr:@denops/std"; - * import { expr, stringify } from "jsr:@denops/std/eval"; + * import { expr } from "jsr:@denops/std/eval/expression"; + * import { stringify } from "jsr:@denops/std/eval/stringify"; * * export async function main(denops: Denops): Promise { * const value = { diff --git a/eval/use_eval.ts b/eval/use_eval.ts index e2dcec99..a15e35a0 100644 --- a/eval/use_eval.ts +++ b/eval/use_eval.ts @@ -1,3 +1,9 @@ +/** + * This module provides the function to use Vim expressions within blocks. + * + * @module + */ + import type { Context, Denops, Dispatcher, Meta } from "@denops/core"; import { isString } from "@core/unknownutil/is/string"; import { isUndefined } from "@core/unknownutil/is/undefined"; @@ -6,13 +12,14 @@ import { execute } from "../helper/execute.ts"; import { stringify } from "./stringify.ts"; /** - * Allows to use {@linkcode [eval].Expression|Expression} and {@linkcode [eval].RawString|RawString} transparently - * within blocks. + * Allows to use {@linkcode [eval].Expression|Expression} and {@linkcode [eval].RawString|RawString} transparently within blocks. * * ```typescript * import type { Denops } from "jsr:@denops/std"; * import * as fn from "jsr:@denops/std/function"; - * import { expr, rawString, useEval } from "jsr:@denops/std/eval"; + * import { expr } from "jsr:@denops/std/eval/expression"; + * import { rawString } from "jsr:@denops/std/eval/string"; + * import { useEval } from "jsr:@denops/std/eval/use-eval"; * * export async function main(denops: Denops): Promise { * await useEval(denops, async (denops) => {