Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何导入TS #46

Open
babyba2009 opened this issue Sep 27, 2021 · 2 comments
Open

如何导入TS #46

babyba2009 opened this issue Sep 27, 2021 · 2 comments

Comments

@babyba2009
Copy link

如何导入Type Script?

@Tithy
Copy link

Tithy commented Nov 12, 2021

同求tyepscript类型定义文件

@ouchuji
Copy link

ouchuji commented Jan 23, 2022

// @ts-ignore
import {ParseAddress} from 'address-parse'

const PARSER = new ParseAddress() as Parser

interface Parser {
    parse(content: string): readonly Address[]
}

export interface Address {
    readonly province: string
    readonly city: string
    readonly area: string
    readonly details: string
    readonly name: string
    readonly code: string,
    readonly mobile: string,
    readonly zip_code: string,
    readonly phone: string
}

export function parse(content: string): Address {
    return PARSER.parse(content)[0]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants