Skip to content

@alneas/business-jp API Reference

Exported symbol legalDocument

export const legalDocument

Exported symbol notifications

export const notifications

Resolves the label (typically family name) to display on a fallback seal.

Priority order:

  1. options.sealLabel
  2. options.familyName
  3. fullName parsing (applying nameOrder rule)

When nameOrder: "auto":

  • Names containing CJK characters: use first token
  • 2 or more Latin words: use last token
  • Otherwise: use first token
export function resolveSealLabel(fullName?: string, options: SealLabelOptions =
Parameter Type Required Description
fullName `string undefined` Optional
options SealLabelOptions Optional Label resolution options
  • Type: string
  • Description: Stamp label ("" if empty)
```ts
resolveSealLabel("山田 太郎") // => "山田"
resolveSealLabel("John Smith") // => "Smith"
resolveSealLabel("TANAKA", { maxChars: 2 }) // => "TA"
---
### `FUNCTION` `createFallbackSealSvg`
Generates an SVG string for a fallback stamp seal.
Can be used as a fallback when no saved stamp image is available.
Output is a simple red circular seal with vertically stacked characters.
```typescript
export function createFallbackSealSvg(
fullName?: string,
options: FallbackSealOptions =
Parameter Type Required Description
fullName `string undefined` Optional
options FallbackSealOptions Optional Generation options
  • Type: string | null
  • Description: SVG string, or null if the seal face label cannot be resolved
```ts
const svg = createFallbackSealSvg("山田 太郎");
---
### `FUNCTION` `createFallbackSealPngDataUrl`
Generates a PNG Data URL for a fallback stamp seal.
Returns `null` in environments where the Canvas API is unavailable.
```typescript
export function createFallbackSealPngDataUrl(
fullName?: string,
options: FallbackSealOptions =
Parameter Type Required Description
fullName `string undefined` Optional
options FallbackSealOptions Optional Generation options
  • Type: string | null
  • Description: PNG Data URL, or null if generation fails

Generates a Data URL for a fallback stamp seal.

Behavior of outputFormat:

  • auto (default): PNG when Canvas is available, otherwise SVG
  • png: PNG only (null if Canvas is unavailable)
  • svg: SVG only
export function createFallbackSealDataUrl(
fullName?: string,
options: FallbackSealOptions =
Parameter Type Required Description
fullName `string undefined` Optional
options FallbackSealOptions Optional Generation options
  • Type: string | null
  • Description: Data URL, or null if the seal face label cannot be resolved
```ts
const dataUrl = createFallbackSealDataUrl("John Smith", { nameOrder: "given-first" });
---
### `TYPE` `SealNameOrder`
Type `SealNameOrder`
```typescript
type SealNameOrder

Options for determining the stamp label (text on the seal face).

interface SealLabelOptions

Options for generating fallback seal SVG or Data URL.

interface FallbackSealOptions

Parses Japanese legal documents formatted in Markdown and returns structured data.

export function parseLegalDocument(markdown: string): ParsedDocument
Parameter Type Required Description
markdown string Yes
  • Type: ParsedDocument

Builds pdfmake document definition content from a ParsedDocument.

export function buildLegalDocumentPdfmakeContent(
parsed: ParsedDocument,
)
Parameter Type Required Description
parsed ParsedDocument Yes
  • Type: { content: any[]; styles: { docTitle: { fontSize: number; bold: boolean; alignment: string; }; docReference: { fontSize: number; }; articleHeader: { fontSize: number; bold: boolean; }; signatureRole: { fontSize: number; bold: boolean; margin: number[]; }; signatureText: { fontSize: number; }; }; pageSize: "A4"; pageMargins: [number, number, number, number]; defaultStyle: { fontSize: number; lineHeight: number; }; }

Type PartyType

type PartyType