#1303 Re-name methods to be full english words
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
import { expect } from "chai";
|
||||
|
||||
import { Formatter } from "export/formatter";
|
||||
import { PageTDirection, PageTextDirection } from "./page-text-direction";
|
||||
import { PageTextDirection, PageTextDirectionType } from "./page-text-direction";
|
||||
|
||||
describe("PageTextDirection", () => {
|
||||
describe("#constructor()", () => {
|
||||
it("should set the direction of the text flow to top-to-bottom-right-to-left", () => {
|
||||
const textDirection = new PageTDirection(PageTextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT);
|
||||
const textDirection = new PageTextDirection(PageTextDirectionType.TOP_TO_BOTTOM_RIGHT_TO_LEFT);
|
||||
|
||||
const tree = new Formatter().format(textDirection);
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export enum PageTextDirection {
|
||||
export enum PageTextDirectionType {
|
||||
LEFT_TO_RIGHT_TOP_TO_BOTTOM = "lrTb",
|
||||
TOP_TO_BOTTOM_RIGHT_TO_LEFT = "tbRl",
|
||||
}
|
||||
|
||||
class PageTextDirectionAttributes extends XmlAttributeComponent<{ readonly val: PageTextDirection }> {
|
||||
class PageTextDirectionAttributes extends XmlAttributeComponent<{ readonly val: PageTextDirectionType }> {
|
||||
protected readonly xmlKeys = { val: "w:val" };
|
||||
}
|
||||
|
||||
export class PageTDirection extends XmlComponent {
|
||||
constructor(value: PageTextDirection) {
|
||||
export class PageTextDirection extends XmlComponent {
|
||||
constructor(value: PageTextDirectionType) {
|
||||
super("w:textDirection");
|
||||
|
||||
this.root.push(
|
||||
|
@ -11,7 +11,7 @@ import { VerticalAlign } from "file/vertical-align";
|
||||
import { PageOrientation } from "./properties";
|
||||
import { LineNumberRestartFormat } from "./properties/line-number";
|
||||
import { PageBorderOffsetFrom } from "./properties/page-borders";
|
||||
import { PageTextDirection } from "./properties/page-text-direction";
|
||||
import { PageTextDirectionType } from "./properties/page-text-direction";
|
||||
import { SectionType } from "./properties/section-type";
|
||||
import { sectionMarginDefaults, sectionPageSizeDefaults, SectionProperties } from "./section-properties";
|
||||
|
||||
@ -263,7 +263,7 @@ describe("SectionProperties", () => {
|
||||
it("should create section properties with text flow direction", () => {
|
||||
const properties = new SectionProperties({
|
||||
page: {
|
||||
textDirection: PageTextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
|
||||
textDirection: PageTextDirectionType.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
|
||||
},
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
|
@ -15,7 +15,7 @@ import { IPageBordersOptions, PageBorders } from "./properties/page-borders";
|
||||
import { IPageMarginAttributes, PageMargin } from "./properties/page-margin";
|
||||
import { IPageNumberTypeAttributes, PageNumberType } from "./properties/page-number";
|
||||
import { IPageSizeAttributes, PageOrientation, PageSize } from "./properties/page-size";
|
||||
import { PageTDirection, PageTextDirection } from "./properties/page-text-direction";
|
||||
import { PageTextDirection, PageTextDirectionType } from "./properties/page-text-direction";
|
||||
import { SectionType, Type } from "./properties/section-type";
|
||||
|
||||
export interface IHeaderFooterGroup<T> {
|
||||
@ -30,7 +30,7 @@ export interface ISectionPropertiesOptions {
|
||||
readonly margin?: IPageMarginAttributes;
|
||||
readonly pageNumbers?: IPageNumberTypeAttributes;
|
||||
readonly borders?: IPageBordersOptions;
|
||||
readonly textDirection?: PageTextDirection;
|
||||
readonly textDirection?: PageTextDirectionType;
|
||||
};
|
||||
readonly grid?: IDocGridAttributesProperties;
|
||||
readonly headerWrapperGroup?: IHeaderFooterGroup<HeaderWrapper>;
|
||||
@ -156,7 +156,7 @@ export class SectionProperties extends XmlComponent {
|
||||
}
|
||||
|
||||
if (textDirection) {
|
||||
this.root.push(new PageTDirection(textDirection));
|
||||
this.root.push(new PageTextDirection(textDirection));
|
||||
}
|
||||
|
||||
this.root.push(new DocumentGrid(linePitch));
|
||||
|
Reference in New Issue
Block a user