Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jun 20, 2024
1 parent df23a83 commit b6a7424
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/compiler-core/src/transforms/transformElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export type PropsExpression = ObjectExpression | CallExpression | ExpressionNode
export function buildProps(
node: ElementNode,
context: TransformContext,
props: ElementNode['props'] = node.props,
props: ElementNode['props'] | undefined = node.props,
isComponent: boolean,
isDynamicComponent: boolean,
ssr = false,
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-core/src/transforms/vBind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const transformBind: DirectiveTransform = (dir, _node, context) => {
export const transformBindShorthand = (
dir: DirectiveNode,
context: TransformContext,
) => {
): void => {
const arg = dir.arg!

const propName = camelize((arg as SimpleExpressionNode).content)
Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity/src/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ReactiveEffect<T = any> {
constructor(
public fn: () => T,
public trigger: () => void,
public scheduler?: EffectScheduler,
public scheduler?: EffectScheduler | undefined,
scope?: EffectScope,
) {
recordEffectScope(this, scope)
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ export function createSetupContext(

export function getComponentPublicInstance(
instance: ComponentInternalInstance,
): Record<string, any> | undefined {
): Record<string, any> | ComponentPublicInstance | null {
if (instance.exposed) {
return (
instance.exposeProxy ||
Expand Down
1 change: 1 addition & 0 deletions packages/runtime-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ const _ssrUtils: {
setCurrentRenderingInstance: typeof setCurrentRenderingInstance
isVNode: typeof isVNode
normalizeVNode: typeof normalizeVNode
getComponentPublicInstance: typeof getComponentPublicInstance
} = {
createComponentInstance,
setupComponent,
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ function locateNonHydratedAsyncRoot(
}
}

export function invalidateMount(hooks: LifecycleHook) {
export function invalidateMount(hooks: LifecycleHook): void {
if (hooks) {
for (let i = 0; i < hooks.length; i++) hooks[i].active = false
}
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/slotFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export enum SlotFlags {
/**
* Dev only
*/
export const slotFlagsText = {
export const slotFlagsText: Record<SlotFlags, string> = {
[SlotFlags.STABLE]: 'STABLE',
[SlotFlags.DYNAMIC]: 'DYNAMIC',
[SlotFlags.FORWARDED]: 'FORWARDED',
Expand Down

0 comments on commit b6a7424

Please sign in to comment.