mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
# 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
47 lines
1.8 KiB
TypeScript
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;
|
|
}
|