Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Unanswered
← How can I enable code completion for Tecton in VS Code?

Hey Kenny,

This is a good question. At the moment, because our React boilerplate doesn't use TypeScript by default, the TectonContext is declared in vanilla JavaScript. Since we can't use Type Annotations in plain JS/X, we are little limited at the time.

If you have already converted your codebase to use TypeScript, doing the following should get you what you want:

// frontend/src/contexts/tecton.ts
import { IActions, ISources } from "q2-tecton-sdk";

const TectonContext = createContext({
  actions: {},
  sources: {},
}, {actions: IActions, sources: ISources});
0

Thanks Kristopher. We found a similar answer and used IPlatformCoreAPI:

import { createContext } from 'react';
import { IPlatformCoreAPI } from 'q2-tecton-sdk';

const TectonContext = createContext<IPlatformCoreAPI>(undefined);

export default TectonContext;
— Kenny Fairris   4 years ago
21 Views
0 Answers
4 years ago
4 years ago