Skip to content

Commit

Permalink
Create TS interfaces for layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsherman committed Nov 21, 2024
1 parent d6dfff9 commit 350df73
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/_components/PostListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export default (data: Lume.Data, helpers: Lume.Helpers) => {
interface PostListItemData extends Lume.Data {
post: Lume.Data;
}
export default (data: PostListItemData, helpers: Lume.Helpers) => {
const { HUMAN_DATE_FORMAT, post } = data;
const { date, url } = helpers;

Expand Down
6 changes: 5 additions & 1 deletion src/_includes/layouts/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export default (data: Lume.Data, helpers: Lume.Helpers) => (
interface LayoutData extends Lume.Data {
cacheBusterVersion: string;
}

export default (data: LayoutData, _helpers: Lume.Helpers) => (
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
6 changes: 5 additions & 1 deletion src/_includes/layouts/post-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export default (data: Lume.Data, helpers: Lume.Helpers) => {
interface PostLayoutData extends Lume.Data {
HUMAN_DATE_FORMAT: string;
}

export default (data: PostLayoutData, helpers: Lume.Helpers) => {
const { HUMAN_DATE_FORMAT } = data;
const { date } = helpers;

Expand Down

0 comments on commit 350df73

Please sign in to comment.