Skip to content

Commit

Permalink
👍 exports sub modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Milly committed Aug 24, 2024
1 parent d087b73 commit b1ec78b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 10 deletions.
8 changes: 8 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
12 changes: 9 additions & 3 deletions eval/expression.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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"
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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`));
*
Expand Down
12 changes: 9 additions & 3 deletions eval/string.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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");
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion eval/stringify.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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<void> {
* const value = {
Expand Down
13 changes: 10 additions & 3 deletions eval/use_eval.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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<void> {
* await useEval(denops, async (denops) => {
Expand Down

0 comments on commit b1ec78b

Please sign in to comment.