Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fower/types

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fower/types - npm Package Compare versions

Comparing version 1.35.0 to 1.36.0

190

index.d.ts
import * as CSS from 'csstype'
import type { Atom } from '@fower/atom'
import type { Parser } from '@fower/parser'

@@ -221,3 +219,3 @@ // tslint:disable-next-line:export-just-namespace

*/
beforeHandleAtom?(atom: Atom, parser: Parser): Atom
beforeHandleAtom?(atom: AtomType, parser: ParserType): AtomType

@@ -229,3 +227,3 @@ /**

*/
handleAtom?(atom: Atom, parser: Parser): Atom
handleAtom?(atom: AtomType, parser: ParserType): AtomType

@@ -236,5 +234,187 @@ /**

*/
afterAtomStyleCreate?(parser: Parser): void
afterAtomStyleCreate?(parser: ParserType): void
}
class ParserType {
atoms: AtomType[]
get config(): Configuration
/**
* convert style object to string
* @param style
* @param meta
* @example
* { width: 10 } -> "width: 10px;"
* { paddingTop: 10, paddingBottom: 10 } -> "padding-top: 10px;padding-bottom: 10px;"
* @returns
*/
addAtom(atom: AtomType): void
/**
* get component classNames
*/
getClassNames(): string[]
}
interface Meta {
/**
* color mode
* @exmple
* mode: 'dark'
*/
mode?: string
/**
* @exmple
* breakpoint: '640px'
*/
breakpoint?: string
/**
* @exmple
* --hover -> hover
* --befor -> befor
*/
pseudo?: string
/**
* @exmple
* --hover -> :
* --befor -> ::
*/
pseudoPrefix?: string
/**
* child selector for atom.className
* @exmple
* childSelector: '.child'
*/
childSelector?: string
/**
* sibling selector for atom.className
* @exmple
* childSelector: '.sibling'
*/
siblingSelector?: string
/**
* parent class for group pseudo
* @exmple
* parentClass: 'group'
*/
parentClass?: string
/**
* is !important style
*/
important?: boolean
/**
* is global style, value is global selector
*/
global?: string
/**
* color name or value
* @example
* gray200--O20 -> gray200
* gray200--T20 -> gray200
* #666--D40 -> #666
* #999--L40 -> #999
*/
color?: string
/**
* color postfix for opacify,transparent,darken,lighten
* @example
* gray200--O20 -> O20
* gray200--T20 -> T20
* #666--D40 -> D40
* #999--L40 -> L40
*/
colorPostfix?: string
}
interface AtomOptions {
propKey: 'css' | 'debug' | ({} & string)
propValue?: any
key?: string
value?: any
meta?: Meta
style?: any
handled?: boolean
}
class AtomType {
private readonly options
constructor(options: AtomOptions)
/**
* string or number prop
* @readonly
* @memberof Atom
*/
get isValueProp(): boolean
/**
* get style keys string
* @readonlyReactElement
* @memberof Atom
* @example
* { color: "#999"} -> color
* { paddingTop: 10, paddingBottom: 10} -> paddingTop-paddingTop
*/
get styleKeys(): string
/**
* get style key hash
* @readonly
* @memberof Atom
* @example
* { color: "#999"} -> color + hashed meta
* { paddingTop: 10, paddingBottom: 10} -> paddingTop-paddingTop + hashed meta
*/
get styleKeysHash(): string
get isFalsePropValue(): boolean
get isTruePropValue(): boolean
/**
* original propKey, 原始的propkey
* @example
* <Box red200></Box> propKey is red200
* <Box red200--hover></Box> propKey is red200--hover
*/
readonly propKey: 'css' | 'debug' | ({} & string)
/**
* original propValue
* @example
* <Box red200></Box> -> true
* <Box p={10}></Box> -> 10
* <Box color="red"></Box> -> red
*/
readonly propValue: any
/**
* get the primitive atomic key, exclude value or posfix
* @example
* m-4 -> m
* m={4} -> m
* m4 -> m
* m4--hover -> m
* m4--sm -> m
* m4--dark--sm-i -> m
*/
key: string
/**
* atom value, get it from PropValue or propKey
* @example
* <Box toCenter></Box> -> true
* <Box m={4}></Box> -> 4
* <Box m-4></Box> -> 4
* <Box m4></Box> -> 16
*/
value: any
meta: Meta
/**
* unique id for cache
*/
id: string
style: CSS.Properties<number | string>
type: 'color' | 'backgroundColor' | 'borderColor' | 'padding' | 'margin' | ({} & string)
/**
* if handled, this atom is ready to push to parser.atoms
*/
handled: boolean
/**
* already inserted to stylesheet
*/
inserted: boolean
/** if not valid, do not generate style */
isValid: boolean
}
interface Theme {

@@ -241,0 +421,0 @@ breakpoints: {

6

package.json
{
"name": "@fower/types",
"version": "1.35.0",
"version": "1.36.0",
"license": "MIT",

@@ -12,7 +12,5 @@ "main": "",

"dependencies": {
"@fower/atom": "^1.35.0",
"@fower/parser": "^1.35.0",
"csstype": "^3.0.8"
},
"gitHead": "83f2de0f856c44fcf1cd86d266c6bdbed1a63491"
"gitHead": "e278b5c6007016eda5ee60a806801f71f0f1078a"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc