Skip to content

Commit

Permalink
[initial-value-templates] Fix type declaration for value property
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Oct 24, 2019
1 parent d7c5ebb commit af3dbd2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@sanity/initial-value-templates/src/Template.ts
@@ -1,12 +1,14 @@
import {TemplateParameter} from './TemplateParameters'

type ValueResolver = (parameters: {[key: string]: any}) => {[key: string]: any}

export interface Template {
id: string
title: string
description?: string
schemaType: string
icon?: Function
value: {[key: string]: any}
value: ValueResolver | {[key: string]: any}
parameters?: TemplateParameter[]
}

Expand Down Expand Up @@ -57,7 +59,7 @@ export class TemplateBuilder {
return this.spec.icon
}

value(value: {[key: string]: any}) {
value(value: ValueResolver | {[key: string]: any}) {
return this.clone({value})
}

Expand Down

0 comments on commit af3dbd2

Please sign in to comment.