Skip to content

fix(typescript): renamed types #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/components/content-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The appropriate HTML element for the page structure is determined based on the `
## Properties

```ts
type Props = {
type ContentContainerProps = {
tag?: string;
rootTags?: string[];
contentTags?: string[];
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/content-headline.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The deeper the nesting, the smaller the heading.
## Properties

```ts
type Props = {
type ContentHeadlineProps = {
tag: string;
debug: boolean;
};
Expand Down
10 changes: 5 additions & 5 deletions src/ContentContainer.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { defineComponent, h, inject, provide, type ComponentOptions } from 'vue';
import useContentContainer from './useContentContainer';

export type Props = {
export type ContentContainerProps = {
tag?: string;
rootTags?: string[];
contentTags?: string[];
level?: number;
debug?: boolean;
};

export type Context = Props & {
export type ContentContainerContext = ContentContainerProps & {
parentLevel: number;
currentLevel: number;
currentTag: string;
Expand Down Expand Up @@ -46,13 +46,13 @@ const ContentContainer = defineComponent({
}
},

setup(props: Props) {
setup(props: ContentContainerProps) {
const { parentLevel, currentLevel, currentTag } = useContentContainer(props);
provide('semanticStructure_debug', props.debug);
return { parentLevel, currentLevel, currentTag };
},

render(this: Context & ComponentOptions) {
render(this: ContentContainerContext & ComponentOptions) {
const { currentTag, parentLevel, currentLevel } = this;

return h(
Expand All @@ -73,7 +73,7 @@ const ContentContainer = defineComponent({
}
});

const getDebugAttrs = (context: Context) => {
const getDebugAttrs = (context: ContentContainerContext) => {
if (context.debug) {
return {
'data-current-tag': context.currentTag,
Expand Down
8 changes: 4 additions & 4 deletions src/ContentHeadline.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defineComponent, h, inject, type ComponentOptions } from 'vue';
import useContentHeadline from './useContentHeadline';

export type Props = {
export type ContentHeadlineProps = {
tag: string;
debug: boolean;
};

export type Context = Props & {
export type ContentHeadlineContext = ContentHeadlineProps & {
parentLevel: number;
currentLevel: number;
currentTag: string;
Expand All @@ -32,7 +32,7 @@ const ContentHeadline = defineComponent({
return { parentLevel, currentLevel, currentTag };
},

render(this: Context & ComponentOptions) {
render(this: ContentHeadlineContext & ComponentOptions) {
const { currentTag, currentLevel } = this;
return h(
currentTag,
Expand All @@ -51,7 +51,7 @@ const ContentHeadline = defineComponent({
}
});

const getDebugAttrs = (context: Context) => {
const getDebugAttrs = (context: ContentHeadlineContext) => {
if (context.debug) {
return {
'data-current-tag': context.currentTag,
Expand Down
Loading