20 lines
592 B
TypeScript
20 lines
592 B
TypeScript
declare module 'relationship.js' {
|
|
interface RelationshipOptions {
|
|
text: string // 关系文本,如"父亲的母亲"
|
|
target?: string // 相对对象
|
|
sex?: number // 性别:0女性,1男性,-1不限
|
|
type?: string // 转换类型
|
|
reverse?: boolean // 称呼方式
|
|
mode?: string // 模式选择
|
|
optimal?: boolean // 最短关系
|
|
}
|
|
|
|
/**
|
|
* 计算中文亲属关系
|
|
* @param options 关系选项
|
|
* @returns 关系称谓数组
|
|
*/
|
|
function relationship(options: RelationshipOptions): string[]
|
|
export default relationship
|
|
}
|