Make internal hyperlink declarative

This commit is contained in:
Dolan Miu
2019-12-21 03:31:09 +00:00
parent c68dc8c52a
commit 3fdbca939e
7 changed files with 52 additions and 27 deletions

View File

@ -2,10 +2,21 @@ import { XmlComponent } from "file/xml-components";
import { DocumentAttributes } from "../document/document-attributes";
import { INumberingOptions } from "../numbering";
import { Paragraph } from "../paragraph";
import { HyperlinkType, Paragraph } from "../paragraph";
import { IStylesOptions } from "../styles";
import { Created, Creator, Description, Keywords, LastModifiedBy, Modified, Revision, Subject, Title } from "./components";
export interface IInternalHyperlinkDefinition {
readonly text: string;
readonly type: HyperlinkType.INTERNAL;
}
export interface IExternalHyperlinkDefinition {
readonly link: string;
readonly text: string;
readonly type: HyperlinkType.EXTERNAL;
}
export interface IPropertiesOptions {
readonly title?: string;
readonly subject?: string;
@ -19,10 +30,7 @@ export interface IPropertiesOptions {
readonly numbering?: INumberingOptions;
readonly footnotes?: Paragraph[];
readonly hyperlinks?: {
readonly [key: string]: {
readonly link: string;
readonly text: string;
};
readonly [key: string]: IInternalHyperlinkDefinition | IExternalHyperlinkDefinition;
};
}