Port forward to ts-rs 8.1 (currently: git only; waiting for 8.1.1+) (#2443)

Port forward to ts-rs 8.1

We're just waiting on a release that includes a PR that we sent[1] for this
to use the cargo version. For now we'll have to use the git release.

[1]: c5109a00e4
This commit is contained in:
Paul Tagliamonte
2024-05-22 14:22:07 -04:00
committed by GitHub
parent e94b1bc12a
commit e3b9a6e5d8
8 changed files with 56 additions and 31 deletions

View File

@ -1,15 +1,15 @@
//! Functions for generating docs for our stdlib functions.
use crate::std::Primitive;
use anyhow::Result;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::path::Path;
use tower_lsp::lsp_types::{
CompletionItem, CompletionItemKind, CompletionItemLabelDetails, Documentation, InsertTextFormat, MarkupContent,
MarkupKind, ParameterInformation, ParameterLabel, SignatureHelp, SignatureInformation,
};
use crate::std::Primitive;
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, ts_rs::TS)]
#[ts(export)]
#[serde(rename_all = "camelCase")]
@ -262,21 +262,30 @@ impl<'de> Deserialize<'de> for Box<dyn StdLibFn> {
}
impl ts_rs::TS for dyn StdLibFn {
const EXPORT_TO: Option<&'static str> = Some("bindings/StdLibFnData");
type WithoutGenerics = Self;
fn name() -> String {
"StdLibFnData".to_string()
}
fn dependencies() -> Vec<ts_rs::Dependency>
where
Self: 'static,
{
StdLibFnData::dependencies()
fn decl() -> String {
StdLibFnData::decl()
}
fn transparent() -> bool {
StdLibFnData::transparent()
fn decl_concrete() -> String {
StdLibFnData::decl_concrete()
}
fn inline() -> String {
StdLibFnData::inline()
}
fn inline_flattened() -> String {
StdLibFnData::inline_flattened()
}
fn output_path() -> Option<&'static Path> {
StdLibFnData::output_path()
}
}