compat

package
v0.0.0-...-8ca6cf8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StringToCSSFeature = map[string]CSSFeature{
	"color-functions":          ColorFunctions,
	"gradient-double-position": GradientDoublePosition,
	"gradient-interpolation":   GradientInterpolation,
	"gradient-midpoints":       GradientMidpoints,
	"hwb":                      HWB,
	"hex-rgba":                 HexRGBA,
	"inline-style":             InlineStyle,
	"inset-property":           InsetProperty,
	"is-pseudo-class":          IsPseudoClass,
	"modern-rgb-hsl":           Modern_RGB_HSL,
	"nesting":                  Nesting,
	"rebecca-purple":           RebeccaPurple,
}
View Source
var StringToJSFeature = map[string]JSFeature{
	"arbitrary-module-namespace-names":  ArbitraryModuleNamespaceNames,
	"array-spread":                      ArraySpread,
	"arrow":                             Arrow,
	"async-await":                       AsyncAwait,
	"async-generator":                   AsyncGenerator,
	"bigint":                            Bigint,
	"class":                             Class,
	"class-field":                       ClassField,
	"class-private-accessor":            ClassPrivateAccessor,
	"class-private-brand-check":         ClassPrivateBrandCheck,
	"class-private-field":               ClassPrivateField,
	"class-private-method":              ClassPrivateMethod,
	"class-private-static-accessor":     ClassPrivateStaticAccessor,
	"class-private-static-field":        ClassPrivateStaticField,
	"class-private-static-method":       ClassPrivateStaticMethod,
	"class-static-blocks":               ClassStaticBlocks,
	"class-static-field":                ClassStaticField,
	"const-and-let":                     ConstAndLet,
	"decorators":                        Decorators,
	"default-argument":                  DefaultArgument,
	"destructuring":                     Destructuring,
	"dynamic-import":                    DynamicImport,
	"exponent-operator":                 ExponentOperator,
	"export-star-as":                    ExportStarAs,
	"for-await":                         ForAwait,
	"for-of":                            ForOf,
	"function-name-configurable":        FunctionNameConfigurable,
	"function-or-class-property-access": FunctionOrClassPropertyAccess,
	"generator":                         Generator,
	"hashbang":                          Hashbang,
	"import-assertions":                 ImportAssertions,
	"import-attributes":                 ImportAttributes,
	"import-meta":                       ImportMeta,
	"inline-script":                     InlineScript,
	"logical-assignment":                LogicalAssignment,
	"nested-rest-binding":               NestedRestBinding,
	"new-target":                        NewTarget,
	"node-colon-prefix-import":          NodeColonPrefixImport,
	"node-colon-prefix-require":         NodeColonPrefixRequire,
	"nullish-coalescing":                NullishCoalescing,
	"object-accessors":                  ObjectAccessors,
	"object-extensions":                 ObjectExtensions,
	"object-rest-spread":                ObjectRestSpread,
	"optional-catch-binding":            OptionalCatchBinding,
	"optional-chain":                    OptionalChain,
	"regexp-dot-all-flag":               RegexpDotAllFlag,
	"regexp-lookbehind-assertions":      RegexpLookbehindAssertions,
	"regexp-match-indices":              RegexpMatchIndices,
	"regexp-named-capture-groups":       RegexpNamedCaptureGroups,
	"regexp-set-notation":               RegexpSetNotation,
	"regexp-sticky-and-unicode-flags":   RegexpStickyAndUnicodeFlags,
	"regexp-unicode-property-escapes":   RegexpUnicodePropertyEscapes,
	"rest-argument":                     RestArgument,
	"template-literal":                  TemplateLiteral,
	"top-level-await":                   TopLevelAwait,
	"typeof-exotic-object-is-object":    TypeofExoticObjectIsObject,
	"unicode-escapes":                   UnicodeEscapes,
	"using":                             Using,
}

Functions

func CSSPrefixData

func CSSPrefixData(constraints map[Engine]Semver) (entries map[css_ast.D]CSSPrefix)

Types

type CSSFeature

type CSSFeature uint16
const (
	ColorFunctions CSSFeature = 1 << iota
	GradientDoublePosition
	GradientInterpolation
	GradientMidpoints
	HWB
	HexRGBA
	InlineStyle
	InsetProperty
	IsPseudoClass
	Modern_RGB_HSL
	Nesting
	RebeccaPurple
)

func UnsupportedCSSFeatures

func UnsupportedCSSFeatures(constraints map[Engine]Semver) (unsupported CSSFeature)

Return all features that are not available in at least one environment

func (CSSFeature) ApplyOverrides

func (features CSSFeature) ApplyOverrides(overrides CSSFeature, mask CSSFeature) CSSFeature

func (CSSFeature) Has

func (features CSSFeature) Has(feature CSSFeature) bool

type CSSPrefix

type CSSPrefix uint8
const (
	KhtmlPrefix CSSPrefix = 1 << iota
	MozPrefix
	MsPrefix
	OPrefix
	WebkitPrefix

	NoPrefix CSSPrefix = 0
)

type Engine

type Engine uint8
const (
	Chrome Engine = iota
	Deno
	Edge
	ES
	Firefox
	Hermes
	IE
	IOS
	Node
	Opera
	Rhino
	Safari
)

func (Engine) IsBrowser

func (e Engine) IsBrowser() bool

func (Engine) String

func (e Engine) String() string

type JSFeature

type JSFeature uint64
const (
	ArbitraryModuleNamespaceNames JSFeature = 1 << iota
	ArraySpread
	Arrow
	AsyncAwait
	AsyncGenerator
	Bigint
	Class
	ClassField
	ClassPrivateAccessor
	ClassPrivateBrandCheck
	ClassPrivateField
	ClassPrivateMethod
	ClassPrivateStaticAccessor
	ClassPrivateStaticField
	ClassPrivateStaticMethod
	ClassStaticBlocks
	ClassStaticField
	ConstAndLet
	Decorators
	DefaultArgument
	Destructuring
	DynamicImport
	ExponentOperator
	ExportStarAs
	ForAwait
	ForOf
	FunctionNameConfigurable
	FunctionOrClassPropertyAccess
	Generator
	Hashbang
	ImportAssertions
	ImportAttributes
	ImportMeta
	InlineScript
	LogicalAssignment
	NestedRestBinding
	NewTarget
	NodeColonPrefixImport
	NodeColonPrefixRequire
	NullishCoalescing
	ObjectAccessors
	ObjectExtensions
	ObjectRestSpread
	OptionalCatchBinding
	OptionalChain
	RegexpDotAllFlag
	RegexpLookbehindAssertions
	RegexpMatchIndices
	RegexpNamedCaptureGroups
	RegexpSetNotation
	RegexpStickyAndUnicodeFlags
	RegexpUnicodePropertyEscapes
	RestArgument
	TemplateLiteral
	TopLevelAwait
	TypeofExoticObjectIsObject
	UnicodeEscapes
	Using
)

func SymbolFeature

func SymbolFeature(kind ast.SymbolKind) JSFeature

func UnsupportedJSFeatures

func UnsupportedJSFeatures(constraints map[Engine]Semver) (unsupported JSFeature)

Return all features that are not available in at least one environment

func (JSFeature) ApplyOverrides

func (features JSFeature) ApplyOverrides(overrides JSFeature, mask JSFeature) JSFeature

func (JSFeature) Has

func (features JSFeature) Has(feature JSFeature) bool

type Semver

type Semver struct {
	// "1.2.3-alpha" => { Parts: {1, 2, 3}, PreRelease: "-alpha" }
	Parts      []int
	PreRelease string
}

func (Semver) String

func (v Semver) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL