Files
docx-js/src/file/paragraph/run/formatting.ts

148 lines
2.8 KiB
TypeScript
Raw Normal View History

import { Attributes, XmlComponent } from "file/xml-components";
2017-03-09 22:56:08 +00:00
export { Underline } from "./underline";
export { SubScript, SuperScript } from "./script";
2017-03-12 17:53:32 +01:00
export { RunFonts } from "./run-fonts";
2016-03-30 04:30:58 +01:00
2016-04-09 20:16:35 +01:00
export class Bold extends XmlComponent {
2016-03-30 04:30:58 +01:00
constructor() {
2016-04-09 20:16:35 +01:00
super("w:b");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-03-30 04:30:58 +01:00
}
}
2016-04-09 20:16:35 +01:00
export class Italics extends XmlComponent {
2016-03-30 04:30:58 +01:00
constructor() {
2016-04-09 20:16:35 +01:00
super("w:i");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-03-30 04:30:58 +01:00
}
}
2016-05-07 20:17:18 +01:00
export class Caps extends XmlComponent {
2016-03-30 04:30:58 +01:00
constructor() {
2016-05-07 20:40:18 +01:00
super("w:caps");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class Color extends XmlComponent {
constructor(color: string) {
super("w:color");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: color,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class DoubleStrike extends XmlComponent {
constructor() {
super("w:dstrike");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class Emboss extends XmlComponent {
constructor() {
super("w:emboss");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class Imprint extends XmlComponent {
constructor() {
super("w:imprint");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class Shadow extends XmlComponent {
constructor() {
super("w:shadow");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class SmallCaps extends XmlComponent {
constructor() {
super("w:smallCaps");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class Strike extends XmlComponent {
constructor() {
super("w:strike");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-03-30 04:30:58 +01:00
}
2016-05-07 20:40:18 +01:00
}
export class Size extends XmlComponent {
constructor(size: number) {
super("w:sz");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: size,
}),
);
2016-05-07 20:40:18 +01:00
}
2017-03-08 20:32:30 +00:00
}
2018-07-24 18:52:45 +03:00
2018-08-07 02:47:24 +01:00
export class SizeComplexScript extends XmlComponent {
2018-07-25 15:02:58 +03:00
constructor(size: number) {
super("w:szCs");
this.root.push(
new Attributes({
val: size,
}),
);
}
}
2018-08-07 02:47:24 +01:00
export class RightToLeft extends XmlComponent {
2018-07-24 18:52:45 +03:00
constructor() {
super("w:rtl");
this.root.push(
new Attributes({
val: true,
}),
);
}
2018-07-25 15:02:58 +03:00
}