Files
jsowell-charger-web/jsowell-ui/node_modules/parenthesis/index.d.ts
Lemon f5e6e29f00 Merge branch 'dev-zza' into dev
# Conflicts:
#	jsowell-ui/.env.development
#	jsowell-ui/.env.staging
#	jsowell-ui/bin/build-sit.bat
#	jsowell-ui/bin/build.bat
#	jsowell-ui/src/api/adapayMember/adapayMember.js
#	jsowell-ui/src/api/pile/merchant.js
#	jsowell-ui/src/router/index.js
#	jsowell-ui/src/views/financial/financeDetail.vue
#	jsowell-ui/src/views/financial/merchant.vue
#	jsowell-ui/src/views/homeIndex/homeIndex.vue
#	jsowell-ui/src/views/login.vue
#	jsowell-ui/src/views/pile/basic/detail.vue
#	jsowell-ui/src/views/pile/station/components/SiteInfo.vue
#	jsowell-ui/src/views/pile/station/detail.vue
#	jsowell-ui/src/views/pile/station/orderReport.vue
2025-06-03 14:26:37 +08:00

47 lines
1.8 KiB
TypeScript

declare module "parenthesis" {
namespace parens {
// One entry in the returned nested array
type Node = string | ArrayTree;
// A nested array of strings
interface ArrayTree extends Array<Node> {}
// Second-argument options used by the function
interface Opts {
// Single brackets string or list of strings to detect brackets. Can be repeating brackets eg. "" or ''.
brackets?: string | string[],
// Escape prefix for flat references.
escape?: string,
// `flat` is a boolean but since it affects return type, it's explicitly specified below
}
// Parse parentheses from a string, return folded arrays
function parse(
str: string,
opts?: string | string[] | (parens.Opts & { flat?: false })
): parens.ArrayTree;
// Parse parentheses from a string, return flat array
function parse(
str: string,
opts: (parens.Opts & { flat: true })
): string[];
// Stringify tokens back. Pass {flat: true} flag for flat tokens array.
function stringify(tokens: ArrayTree, opts?: {flat: boolean}): string;
}
// Parse parentheses from a string, return folded arrays
function parens(
str: string,
opts?: string | string[] | (parens.Opts & { flat?: false })
): parens.ArrayTree;
// Parse parentheses from a string, return flat array
function parens(
str: string,
opts: (parens.Opts & { flat: true })
): string[];
function parens(tokens: parens.ArrayTree, opts?: {flat: boolean}): string;
// imports via `import paren from "parenthesis", can call the export
// directly or use `paren.parse` / `paren.stringify`.
export = parens;
}