Skip to content

Commit fe90182

Browse files
committed
Change file to TS
1 parent 8f4756e commit fe90182

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/custom-properties/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19+
"@theme-ui/core": "^0.3.1",
1920
"pluralize": "^8.0.0"
2021
},
2122
"devDependencies": {

packages/custom-properties/src/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import pluralize from 'pluralize'
2+
import { Theme } from '@theme-ui/core/dist/theme'
23

3-
export default (theme, prefix) => {
4-
const customProperties = {}
4+
interface CustomProperties {
5+
[key: string]: string | number
6+
}
7+
8+
export default (theme: Theme, prefix?: string) => {
9+
const customProperties: CustomProperties = {}
510

6-
const generateProperties = (object, previousKey) => {
11+
const generateProperties = (object: object, previousKey?: string) => {
712
Object.entries(object).forEach(([key, value]) => {
813
let formattedKey = pluralize(key, 1)
914

0 commit comments

Comments
 (0)