-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 add keyframes() addon typings
- Loading branch information
Showing
4 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {CssLikeObject} from '../common'; | ||
import {NanoRenderer} from '../nano'; | ||
|
||
export interface KeyframesPatch { | ||
/** | ||
* @param frames Map of keyframes. | ||
* @param block Optional semantic name. | ||
* | ||
* Returns a generated animation name. | ||
* | ||
* ```js | ||
* const animationName = nano.keyframes({ | ||
* from: { | ||
* left: '0%', | ||
* }, | ||
* to: { | ||
* left: '100%', | ||
* }, | ||
* }); | ||
* ``` | ||
* | ||
* You need to install [`keyframes()` addon]()https://github.com/streamich/nano-css/blob/master/docs/keyframes.md) to use this method. | ||
* | ||
* ```js | ||
* import {create} from 'nano-css'; | ||
* import {addon as addonKeyframes} from 'nano-css/addon/keyframes'; | ||
* | ||
* const nano = create(); | ||
* addonKeyframes(nano); | ||
* ``` | ||
*/ | ||
keyframes: (frames: object, block?: string) => string; | ||
} | ||
|
||
export type KeyframesAddon = <T extends NanoRenderer>(nano: T) => T & KeyframesPatch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters