|
1 | | -import type { ResolvableProperties, UseHeadInput, UseHeadOptions } from '@unhead/vue' |
| 1 | +import type { DeepResolvableProperties, UseHeadInput, UseHeadOptions } from '@unhead/vue' |
2 | 2 | import type { ActiveHeadEntry } from 'unhead/types' |
3 | 3 | import type { |
4 | 4 | AggregateOffer, |
@@ -53,113 +53,113 @@ function provideResolver<T>(input?: T, resolver?: string) { |
53 | 53 | return input |
54 | 54 | } |
55 | 55 |
|
56 | | -export function defineAddress<T extends Record<string, any>>(input?: ResolvableProperties<PostalAddress & T>) { |
| 56 | +export function defineAddress<T extends Record<string, any>>(input?: DeepResolvableProperties<PostalAddress & T>) { |
57 | 57 | return provideResolver(input, 'address') |
58 | 58 | } |
59 | | -export function defineAggregateOffer<T extends Record<string, any>>(input?: ResolvableProperties<AggregateOffer & T>) { |
| 59 | +export function defineAggregateOffer<T extends Record<string, any>>(input?: DeepResolvableProperties<AggregateOffer & T>) { |
60 | 60 | return provideResolver(input, 'aggregateOffer') |
61 | 61 | } |
62 | | -export function defineAggregateRating<T extends Record<string, any>>(input?: ResolvableProperties<AggregateRating & T>) { |
| 62 | +export function defineAggregateRating<T extends Record<string, any>>(input?: DeepResolvableProperties<AggregateRating & T>) { |
63 | 63 | return provideResolver(input, 'aggregateRating') |
64 | 64 | } |
65 | | -export function defineArticle<T extends Record<string, any>>(input?: ResolvableProperties<Article & T>) { |
| 65 | +export function defineArticle<T extends Record<string, any>>(input?: DeepResolvableProperties<Article & T>) { |
66 | 66 | return provideResolver(input, 'article') |
67 | 67 | } |
68 | | -export function defineBreadcrumb<T extends Record<string, any>>(input?: ResolvableProperties<BreadcrumbList & T>) { |
| 68 | +export function defineBreadcrumb<T extends Record<string, any>>(input?: DeepResolvableProperties<BreadcrumbList & T>) { |
69 | 69 | return provideResolver(input, 'breadcrumb') |
70 | 70 | } |
71 | | -export function defineComment<T extends Record<string, any>>(input?: ResolvableProperties<Comment & T>) { |
| 71 | +export function defineComment<T extends Record<string, any>>(input?: DeepResolvableProperties<Comment & T>) { |
72 | 72 | return provideResolver(input, 'comment') |
73 | 73 | } |
74 | | -export function defineEvent<T extends Record<string, any>>(input?: ResolvableProperties<Event & T>) { |
| 74 | +export function defineEvent<T extends Record<string, any>>(input?: DeepResolvableProperties<Event & T>) { |
75 | 75 | return provideResolver(input, 'event') |
76 | 76 | } |
77 | | -export function defineFoodEstablishment<T extends Record<string, any>>(input?: ResolvableProperties<FoodEstablishment & T>) { |
| 77 | +export function defineFoodEstablishment<T extends Record<string, any>>(input?: DeepResolvableProperties<FoodEstablishment & T>) { |
78 | 78 | return provideResolver(input, 'foodEstablishment') |
79 | 79 | } |
80 | | -export function defineVirtualLocation<T extends Record<string, any>>(input?: ResolvableProperties<VirtualLocation & T>) { |
| 80 | +export function defineVirtualLocation<T extends Record<string, any>>(input?: DeepResolvableProperties<VirtualLocation & T>) { |
81 | 81 | return provideResolver(input, 'virtualLocation') |
82 | 82 | } |
83 | | -export function definePlace<T extends Record<string, any>>(input?: ResolvableProperties<Place & T>) { |
| 83 | +export function definePlace<T extends Record<string, any>>(input?: DeepResolvableProperties<Place & T>) { |
84 | 84 | return provideResolver(input, 'place') |
85 | 85 | } |
86 | | -export function defineHowTo<T extends Record<string, any>>(input?: ResolvableProperties<HowTo & T>) { |
| 86 | +export function defineHowTo<T extends Record<string, any>>(input?: DeepResolvableProperties<HowTo & T>) { |
87 | 87 | return provideResolver(input, 'howTo') |
88 | 88 | } |
89 | | -export function defineHowToStep<T extends Record<string, any>>(input?: ResolvableProperties<HowToStep & T>) { |
| 89 | +export function defineHowToStep<T extends Record<string, any>>(input?: DeepResolvableProperties<HowToStep & T>) { |
90 | 90 | return provideResolver(input, 'howToStep') |
91 | 91 | } |
92 | | -export function defineImage<T extends Record<string, any>>(input?: ResolvableProperties<ImageObject & T>) { |
| 92 | +export function defineImage<T extends Record<string, any>>(input?: DeepResolvableProperties<ImageObject & T>) { |
93 | 93 | return provideResolver(input, 'image') |
94 | 94 | } |
95 | | -export function defineJobPosting<T extends Record<string, any>>(input?: ResolvableProperties<JobPosting & T>) { |
| 95 | +export function defineJobPosting<T extends Record<string, any>>(input?: DeepResolvableProperties<JobPosting & T>) { |
96 | 96 | return provideResolver(input, 'jobPosting') |
97 | 97 | } |
98 | | -export function defineLocalBusiness<T extends Record<string, any>>(input?: ResolvableProperties<LocalBusiness & T>) { |
| 98 | +export function defineLocalBusiness<T extends Record<string, any>>(input?: DeepResolvableProperties<LocalBusiness & T>) { |
99 | 99 | return provideResolver(input, 'localBusiness') |
100 | 100 | } |
101 | | -export function defineOffer<T extends Record<string, any>>(input?: ResolvableProperties<Offer & T>) { |
| 101 | +export function defineOffer<T extends Record<string, any>>(input?: DeepResolvableProperties<Offer & T>) { |
102 | 102 | return provideResolver(input, 'offer') |
103 | 103 | } |
104 | | -export function defineOpeningHours<T extends Record<string, any>>(input?: ResolvableProperties<OpeningHoursSpecification & T>) { |
| 104 | +export function defineOpeningHours<T extends Record<string, any>>(input?: DeepResolvableProperties<OpeningHoursSpecification & T>) { |
105 | 105 | return provideResolver(input, 'openingHours') |
106 | 106 | } |
107 | | -export function defineOrganization<T extends Record<string, any>>(input?: ResolvableProperties<Organization & T>) { |
| 107 | +export function defineOrganization<T extends Record<string, any>>(input?: DeepResolvableProperties<Organization & T>) { |
108 | 108 | return provideResolver(input, 'organization') |
109 | 109 | } |
110 | | -export function definePerson<T extends Record<string, any>>(input?: ResolvableProperties<Person & T>) { |
| 110 | +export function definePerson<T extends Record<string, any>>(input?: DeepResolvableProperties<Person & T>) { |
111 | 111 | return provideResolver(input, 'person') |
112 | 112 | } |
113 | | -export function defineProduct<T extends Record<string, any>>(input?: ResolvableProperties<Product & T>) { |
| 113 | +export function defineProduct<T extends Record<string, any>>(input?: DeepResolvableProperties<Product & T>) { |
114 | 114 | return provideResolver(input, 'product') |
115 | 115 | } |
116 | | -export function defineQuestion<T extends Record<string, any>>(input?: ResolvableProperties<Question & T>) { |
| 116 | +export function defineQuestion<T extends Record<string, any>>(input?: DeepResolvableProperties<Question & T>) { |
117 | 117 | return provideResolver(input, 'question') |
118 | 118 | } |
119 | | -export function defineRecipe<T extends Record<string, any>>(input?: ResolvableProperties<Recipe & T>) { |
| 119 | +export function defineRecipe<T extends Record<string, any>>(input?: DeepResolvableProperties<Recipe & T>) { |
120 | 120 | return provideResolver(input, 'recipe') |
121 | 121 | } |
122 | | -export function defineReview<T extends Record<string, any>>(input?: ResolvableProperties<Review & T>) { |
| 122 | +export function defineReview<T extends Record<string, any>>(input?: DeepResolvableProperties<Review & T>) { |
123 | 123 | return provideResolver(input, 'review') |
124 | 124 | } |
125 | | -export function defineVideo<T extends Record<string, any>>(input?: ResolvableProperties<VideoObject & T>) { |
| 125 | +export function defineVideo<T extends Record<string, any>>(input?: DeepResolvableProperties<VideoObject & T>) { |
126 | 126 | return provideResolver(input, 'video') |
127 | 127 | } |
128 | | -export function defineWebPage<T extends Record<string, any>>(input?: ResolvableProperties<WebPage & T>) { |
| 128 | +export function defineWebPage<T extends Record<string, any>>(input?: DeepResolvableProperties<WebPage & T>) { |
129 | 129 | return provideResolver(input, 'webPage') |
130 | 130 | } |
131 | | -export function defineWebSite<T extends Record<string, any>>(input?: ResolvableProperties<WebSite & T>) { |
| 131 | +export function defineWebSite<T extends Record<string, any>>(input?: DeepResolvableProperties<WebSite & T>) { |
132 | 132 | return provideResolver(input, 'webSite') |
133 | 133 | } |
134 | | -export function defineBook<T extends Record<string, any>>(input?: ResolvableProperties<Book & T>) { |
| 134 | +export function defineBook<T extends Record<string, any>>(input?: DeepResolvableProperties<Book & T>) { |
135 | 135 | return provideResolver(input, 'book') |
136 | 136 | } |
137 | | -export function defineCourse<T extends Record<string, any>>(input?: ResolvableProperties<Course & T>) { |
| 137 | +export function defineCourse<T extends Record<string, any>>(input?: DeepResolvableProperties<Course & T>) { |
138 | 138 | return provideResolver(input, 'course') |
139 | 139 | } |
140 | | -export function defineItemList<T extends Record<string, any>>(input?: ResolvableProperties<ItemList & T>) { |
| 140 | +export function defineItemList<T extends Record<string, any>>(input?: DeepResolvableProperties<ItemList & T>) { |
141 | 141 | return provideResolver(input, 'itemList') |
142 | 142 | } |
143 | | -export function defineListItem<T extends Record<string, any>>(input?: ResolvableProperties<ListItem & T>) { |
| 143 | +export function defineListItem<T extends Record<string, any>>(input?: DeepResolvableProperties<ListItem & T>) { |
144 | 144 | return provideResolver(input, 'listItem') |
145 | 145 | } |
146 | | -export function defineMovie<T extends Record<string, any>>(input?: ResolvableProperties<Movie & T>) { |
| 146 | +export function defineMovie<T extends Record<string, any>>(input?: DeepResolvableProperties<Movie & T>) { |
147 | 147 | return provideResolver(input, 'movie') |
148 | 148 | } |
149 | | -export function defineSearchAction<T extends Record<string, any>>(input?: ResolvableProperties<SearchAction & T>) { |
| 149 | +export function defineSearchAction<T extends Record<string, any>>(input?: DeepResolvableProperties<SearchAction & T>) { |
150 | 150 | return provideResolver(input, 'searchAction') |
151 | 151 | } |
152 | | -export function defineReadAction<T extends Record<string, any>>(input?: ResolvableProperties<ReadAction & T>) { |
| 152 | +export function defineReadAction<T extends Record<string, any>>(input?: DeepResolvableProperties<ReadAction & T>) { |
153 | 153 | return provideResolver(input, 'readAction') |
154 | 154 | } |
155 | | -export function defineSoftwareApp<T extends Record<string, any>>(input?: ResolvableProperties<SoftwareApp & T>) { |
| 155 | +export function defineSoftwareApp<T extends Record<string, any>>(input?: DeepResolvableProperties<SoftwareApp & T>) { |
156 | 156 | return provideResolver(input, 'softwareApp') |
157 | 157 | } |
158 | | -export function defineBookEdition<T extends Record<string, any>>(input?: ResolvableProperties<BookEdition & T>) { |
| 158 | +export function defineBookEdition<T extends Record<string, any>>(input?: DeepResolvableProperties<BookEdition & T>) { |
159 | 159 | return provideResolver(input, 'bookEdition') |
160 | 160 | } |
161 | 161 |
|
162 | | -export type UseSchemaOrgInput = Arrayable<ResolvableProperties<Thing | Record<string, any>>> |
| 162 | +export type UseSchemaOrgInput = Arrayable<DeepResolvableProperties<Thing | Record<string, any>>> |
163 | 163 |
|
164 | 164 | export function useSchemaOrg(input: UseSchemaOrgInput = [], options: UseHeadOptions = {}): ActiveHeadEntry<UseSchemaOrgInput> { |
165 | 165 | // lazy initialise the plugin |
|
0 commit comments