Merge pull request #3 from dolanmiu/master
merge latest changes from Dolans master
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
|
||||
- Simple, declarative API
|
||||
- 60+ usage examples
|
||||
- Battle tested, mature, 98%+ coverage
|
||||
- Battle tested, mature, 99%+ coverage
|
||||
|
||||
[GitHub](https://github.com/dolanmiu/docx)
|
||||
[Get Started](#Welcome)
|
||||
|
@ -180,12 +180,12 @@ Adding spacing between paragraphs
|
||||
|
||||
### ISpacingProperties
|
||||
|
||||
| Property | Type | Notes |
|
||||
| -------- | -------------- | -------- |
|
||||
| after | `number` | Optional |
|
||||
| before | `number` | Optional |
|
||||
| line | `number` | Optional |
|
||||
| lineRule | `LineRuleType` | Optional |
|
||||
| Property | Type | Notes | Possible Values |
|
||||
| -------- | -------------- | -------- | ----------------------------- |
|
||||
| after | `number` | Optional | |
|
||||
| before | `number` | Optional | |
|
||||
| line | `number` | Optional | |
|
||||
| lineRule | `LineRuleType` | Optional | `AT_LEAST`, `EXACTLY`, `AUTO` |
|
||||
|
||||
**Example:**
|
||||
|
||||
|
78
package-lock.json
generated
78
package-lock.json
generated
@ -534,9 +534,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/chai": {
|
||||
"version": "4.2.21",
|
||||
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.21.tgz",
|
||||
"integrity": "sha512-yd+9qKmJxm496BOV9CMNaey8TWsikaZOwMRwPHQIjcOJM9oV+fi9ZMNw3JsVnbEEbo2gRTDnGEBv8pjyn67hNg==",
|
||||
"version": "4.2.22",
|
||||
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz",
|
||||
"integrity": "sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/color-name": {
|
||||
@ -590,9 +590,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "16.9.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.2.tgz",
|
||||
"integrity": "sha512-ZHty/hKoOLZvSz6BtP1g7tc7nUeJhoCf3flLjh8ZEv1vFKBWHXcnMbJMyN/pftSljNyy0kNW/UqI3DccnBnZ8w=="
|
||||
"version": "16.9.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz",
|
||||
"integrity": "sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ=="
|
||||
},
|
||||
"@types/request": {
|
||||
"version": "2.48.6",
|
||||
@ -630,23 +630,12 @@
|
||||
}
|
||||
},
|
||||
"@types/sinon": {
|
||||
"version": "10.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.2.tgz",
|
||||
"integrity": "sha512-BHn8Bpkapj8Wdfxvh2jWIUoaYB/9/XhsL0oOvBfRagJtKlSl9NWPcFOz2lRukI9szwGxFtYZCTejJSqsGDbdmw==",
|
||||
"version": "10.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.3.tgz",
|
||||
"integrity": "sha512-XUaFuUOQ3A/r6gS1qCU/USMleascaqGeQpGR1AZ5JdRtBPlzijRzKsik1TuGzvdtPA0mdq42JqaJmJ+Afg1LJg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@sinonjs/fake-timers": "^7.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sinonjs/fake-timers": {
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz",
|
||||
"integrity": "sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@sinonjs/commons": "^1.7.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@types/tough-cookie": {
|
||||
@ -3083,14 +3072,11 @@
|
||||
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
|
||||
"dev": true
|
||||
},
|
||||
"json5": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
|
||||
"integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
"jsonc-parser": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz",
|
||||
"integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==",
|
||||
"dev": true
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "4.0.0",
|
||||
@ -3436,9 +3422,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"marked": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-3.0.3.tgz",
|
||||
"integrity": "sha512-4oIDhVSQ2s+xNCfek9OnZgCQR/WykGCom02JzIIvi4Pme+MIwPYqvGVW8CQWOXeoZu0TtVB6pTxIuoLm+dKqDA==",
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-3.0.4.tgz",
|
||||
"integrity": "sha512-jBo8AOayNaEcvBhNobg6/BLhdsK3NvnKWJg33MAAPbvTWiG4QBn9gpW1+7RssrKu4K1dKlN+0goVQwV41xEfOA==",
|
||||
"dev": true
|
||||
},
|
||||
"medium-zoom": {
|
||||
@ -4301,9 +4287,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"prismjs": {
|
||||
"version": "1.24.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.0.tgz",
|
||||
"integrity": "sha512-SqV5GRsNqnzCL8k5dfAjCNhUrF3pR0A9lTDSCUZeh/LIshheXJEaP0hwLz2t4XHivd2J/v2HR+gRnigzeKe3cQ==",
|
||||
"version": "1.25.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz",
|
||||
"integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg==",
|
||||
"dev": true
|
||||
},
|
||||
"process": {
|
||||
@ -4813,12 +4799,12 @@
|
||||
}
|
||||
},
|
||||
"shiki": {
|
||||
"version": "0.9.10",
|
||||
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.10.tgz",
|
||||
"integrity": "sha512-xeM7Oc6hY+6iW5O/T5hor8ul7mEprzyl5y4r5zthEHToQNw7MIhREMgU3r2gKDB0NaMLNrkcEQagudCdzE13Lg==",
|
||||
"version": "0.9.11",
|
||||
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.11.tgz",
|
||||
"integrity": "sha512-tjruNTLFhU0hruCPoJP0y+B9LKOmcqUhTpxn7pcJB3fa+04gFChuEmxmrUfOJ7ZO6Jd+HwMnDHgY3lv3Tqonuw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"json5": "^2.2.0",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"onigasm": "^2.2.5",
|
||||
"vscode-textmate": "5.2.0"
|
||||
}
|
||||
@ -5183,9 +5169,9 @@
|
||||
}
|
||||
},
|
||||
"ts-loader": {
|
||||
"version": "9.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.5.tgz",
|
||||
"integrity": "sha512-al/ATFEffybdRMUIr5zMEWQdVnCGMUA9d3fXJ8dBVvBlzytPvIszoG9kZoR+94k6/i293RnVOXwMaWbXhNy9pQ==",
|
||||
"version": "9.2.6",
|
||||
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz",
|
||||
"integrity": "sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^4.1.0",
|
||||
@ -5435,16 +5421,16 @@
|
||||
}
|
||||
},
|
||||
"typedoc": {
|
||||
"version": "0.22.3",
|
||||
"resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.22.3.tgz",
|
||||
"integrity": "sha512-EOWf9Vf3Vfb/jzBzr87uoLybQw9fx3iyXLUcpQn9F2Ks1/ZJN9iGeBbYRU+VNqrWvV4T+aS7Ife7GFEJUf0ohQ==",
|
||||
"version": "0.22.4",
|
||||
"resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.22.4.tgz",
|
||||
"integrity": "sha512-M/a8NnPxq3/iZNNVjzFCK5gu4m//HTJIPbSS0JQVbkHJPP9wyepR12agylWTSqeVZe0xsbidVtO26+PP7iD/jw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.7",
|
||||
"lunr": "^2.3.9",
|
||||
"marked": "^3.0.3",
|
||||
"marked": "^3.0.4",
|
||||
"minimatch": "^3.0.4",
|
||||
"shiki": "^0.9.10"
|
||||
"shiki": "^0.9.11"
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { decimalNumber } from "file/values";
|
||||
import { Attributes, NumberValueElement, XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
import { AlignmentType } from "../paragraph/formatting";
|
||||
import { IParagraphStylePropertiesOptions, ParagraphProperties } from "../paragraph/properties";
|
||||
import { ILevelParagraphStylePropertiesOptions, ParagraphProperties } from "../paragraph/properties";
|
||||
import { IRunStylePropertiesOptions, RunProperties } from "../paragraph/run/properties";
|
||||
|
||||
export enum LevelFormat {
|
||||
@ -88,7 +88,7 @@ export interface ILevelsOptions {
|
||||
readonly suffix?: LevelSuffix;
|
||||
readonly style?: {
|
||||
readonly run?: IRunStylePropertiesOptions;
|
||||
readonly paragraph?: IParagraphStylePropertiesOptions;
|
||||
readonly paragraph?: ILevelParagraphStylePropertiesOptions;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ import { NumberProperties } from "./formatting/unordered-list";
|
||||
import { FrameProperties, IFrameOptions } from "./frame/frame-properties";
|
||||
import { OutlineLevel } from "./links";
|
||||
|
||||
export interface IParagraphStylePropertiesOptions {
|
||||
export interface ILevelParagraphStylePropertiesOptions {
|
||||
readonly alignment?: AlignmentType;
|
||||
readonly thematicBreak?: boolean;
|
||||
readonly contextualSpacing?: boolean;
|
||||
@ -24,6 +24,9 @@ export interface IParagraphStylePropertiesOptions {
|
||||
readonly keepNext?: boolean;
|
||||
readonly keepLines?: boolean;
|
||||
readonly outlineLevel?: number;
|
||||
}
|
||||
|
||||
export interface IParagraphStylePropertiesOptions extends ILevelParagraphStylePropertiesOptions {
|
||||
readonly numbering?: {
|
||||
readonly reference: string;
|
||||
readonly level: number;
|
||||
|
Reference in New Issue
Block a user