Taiyi 合约
合约内置函数和模块的 LuaCATS 类型标注,可以用于 VSCode 等基于 lua lsp 的 IDE 中
| Verifying that I control the following Nostr public key: npub1p2kletrnyajz2z0vytktqswju5jheknx53t9adp3z33ehl5a9lcq8gk0a7 |
| 'use client' | |
| import { useIsomorphicLayoutEffect } from 'some-lib-or-your-source' | |
| import { DependencyList, useState } from 'react' | |
| export function useSupport(assert: () => boolean, deps: DependencyList = []) { | |
| const [support, setSupport] = useState(false) | |
| useIsomorphicLayoutEffect(() => { | |
| setSupport(assert()) |
| const cookies = [ | |
| 'sessionid=sessionid', | |
| 'sessionid_sign=sessionid_sign' | |
| ]; | |
| try { | |
| const response = await fetch('https://cn.tradingview.com/', { | |
| headers: { | |
| 'Cookie': cookies.join('; ') | |
| } |
| { | |
| "url": "http://localhost:5173/", | |
| "name": "TON Crowdfunding", | |
| "iconUrl": "http://localhost:5173/vite.svg" | |
| } |
| const __internalStore = new Map<string, any>() | |
| const __listeners = new Set<() => void>() | |
| const cache = { | |
| set(key: string, value: any) { | |
| __internalStore.set(key, value); | |
| __listeners.forEach(listener => listener()); | |
| }, | |
| delete(key: string) { | |
| __internalStore.delete(key); |
| import type { ObjectDirective } from 'vue' | |
| /** | |
| * @reference https://developer.mozilla.org/en-US/docs/Web/API/ScrollTimeline | |
| */ | |
| declare const ScrollTimeline: any | |
| function shouldAnimationBeStopped(animation: CSSAnimation, animationName: string | null = null) { | |
| if (!ScrollTimeline || !(animation.timeline instanceof ScrollTimeline)) | |
| return false |
| const waitForElement = (/** @type {string}*/selector) => { | |
| return new Promise((resolve) => { | |
| const observer = new MutationObserver(() => { | |
| const target = document.querySelector(selector) | |
| if (target) { | |
| observer.disconnect() | |
| resolve() | |
| } | |
| }) | |
| observer.observe(document, { childList: true, subtree: true, attributes: false }) |
| import { useCallback, useRef, useState, useSyncExternalStore } from 'react' | |
| type Listener = () => void | |
| interface UseAsyncReturn<T> { | |
| data: T | undefined | |
| error: any | |
| isLoading: boolean | |
| refresh: () => void | |
| } |
| .button { | |
| --primary: #275EFE; | |
| --primary-dark: #2055EE; | |
| --primary-darkest: #133FC0; | |
| --text: #FFFFFF; | |
| --text-opacity: 1; | |
| --success: #2B3044; | |
| --success-scale: .2; | |
| --success-opacity: 0; | |
| --border-radius: 7; |