npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

msotype

v1.0.1

Published

TypeScript definitions for MSO (Microsoft Office), including definitions for the mso- CSS vendor prefix.

Downloads

44

Readme

MSOType

TypeScript definitions for MSO (Microsoft Office), including definitions for the mso- CSS vendor prefix. Autocompletion and type checking for all known MSO properties and values are provided.

Install with yarn:

yarn add msotype

Or install with npm:

npm install msotype

Properties

All properties are categorized in different uses and come in two technical variations—JavaScript case (camel) and CSS kebab (case)—to provide typings that suits different needs.

Variations:

  • Default - Property names in JavaScript (camel) case
  • Hyphen - Property names in CSS (kebab) case

Alternative & Standard Types

All of the following interfaces accept an optional, generic argument, to define the <length> value. It defaults to string | 0. You can specify this when using libraries that accepts any numeric value as length which is common in CSS-in-JS libraries like EmotionJS.

| | Default | Hyphen | | :-------------- | :---------------------- | :---------------------------- | | All | Properties | PropertiesHyphen | | Alternative | AlternativeProperties | AlternativePropertiesHyphen | | Standard | StandardProperties | StandardPropertiesHyphen |

Categories:

  • All - Includes Alternative and Standard
  • Alternative - Properties that end with an -alt postfix that are direct alternatives to a standard CSS property
  • Standard - Properties that correspond to a Microsoft Office feature. While these do not have a CSS equivalent, they may or may not have an effect on Microsoft Outlook

Font Types

Interfaces with descriptors for different MSO font types.

| | Default | Hyphen | | :------------ | :------------------ | :------------------------ | | All | FontProperties | FontPropertiesHyphen | | Ansi | AnsiProperties | AnsiPropertiesHyphen | | Ascii | AsciiProperties | AsciiropertiesHyphen | | Bidi | BidiProperties | BidiPropertiesHyphen | | Fareast | FareastProperties | FareastPropertiesHyphen | | Panose | PanoseProperties | PanosePropertiesHyphen |

Categories:

  • All - Includes Ansi, Ascii, Bidi, Fareast, and Panose
  • Ansi - Ansi specific font properties
  • Ascii - Ascii specific font properties
  • Bidi - Bidi specific font properties
  • Fareast - Fareast specific font properties
  • Panose - Panose specific font properties

Using Default Variation

JavaScript cased (camel) properties are provided in Mso.Properties and Mso.FontProperties.

import * as Mso from 'msotype';

const styles: Mso.Properties = {
  msoFontAlt: 'Helvetica',
  msoLineHeightRule: 'exactly',
};

Using Hyphen Variation

Hyphen cased (kebab) properties are provided in Mso.PropertiesHyphen. These not not included by default in Mso.Properties. To allow both of them, you can simply extend with Mso.PropertiesHyphen.

import * as Mso from 'msotype';

interface Style extends Mso.Properties, Mso.PropertiesHyphen {}

const style: Style = {
  'mso-margin-alt': 0,
  msoPaddingAlt: 0,
};

This also works with Mso.FontPropertiesHyphen, which can be used to extend Mso.FontProperties.

import * as Mso from 'msotype';

interface Style extends Mso.FontProperties, Mso.FontPropertiesHyphen {}

const style: Style = {
  'mso-ansi-font-size': 'large',
  msoBidiFlag: 'on',
};

Overriding <length>

Length defaults to string | 0. But it's possible to override it using generics.

import * as Mso from 'msotype';

const style: Mso.Properties<string | number> = {
  msoMarginAlt: '0px',
  msoPaddingAlt: 0,
};

Type Check All CSS Properties

By default, only mso- CSS vendor prefixes are provided. If you want to type check all CSS properties, you can use msotype together with csstype. To do this, you can simply extend any csstype type with any msotype type.

import * as Css from 'csstype';
import * as Mso from 'msotype';

interface Styles extends Css.Properties, Mso.Properties {}

const styles: Styles = {
  msoFontAlt: 'Helvetica',
  msoLineHeightRule: 'exactly',
  lineHeight: 1.4,
};

More