import { useMemo, useState } from 'react'; import jsdocJson from '../../../../../doc.json'; import { Textbox } from '../textbox/Textbox'; const availableFunctions = jsdocJson.docs .filter(({ name, description }) => name && !name.startsWith('_') && !!description) .sort((a, b) => /* a.meta.filename.localeCompare(b.meta.filename) + */ a.name.localeCompare(b.name)); const getInnerText = (html) => { var div = document.createElement('div'); div.innerHTML = html; return div.textContent || div.innerText || ''; }; export function Reference() { const [search, setSearch] = useState(''); const visibleFunctions = useMemo(() => { return availableFunctions.filter((entry) => { if (!search) { return true; } return entry.name.includes(search) || (entry.synonyms?.some((s) => s.includes(search)) ?? false); }); }, [search]); return (
This is the long list of functions you can use. Remember that you don't need to remember all of those and that you can already make music with a small set of functions!
{visibleFunctions.map((entry, i) => (
Synonyms: {entry.synonyms_text}
{example}
))}