type-declaration Questions
2
Given the following folder structure:
src/
├── foo.ts
├── bar.ts
├── baz.ts
├── index.ts
Where foo.ts, bar.ts, and baz.ts each export a default class or thing: i.e. in the case of foo.ts:
expor...
Phenylamine asked 30/10, 2018 at 8:13
7
Solved
To be more exact, the "callable" used in function declaration arguments. like the one below.
function post($pattern, callable $handler) {
$this->routes['post'][$pattern] = $handler;
...
Dead asked 13/1, 2019 at 6:44
1
Solved
I'm currently learning about OCaml, and especially functors. I looked at map.mli from the standard library, and around line 70, there is :
type key
(** The type of the map keys. *)
type !+'a t
(**...
Changchun asked 22/12, 2021 at 14:44
3
Solved
I am writing a type declaration file for a library I do not control. One of the methods accepts an array of strings as a parameter, but these strings can only be very specific values. Currently I a...
Anneliese asked 27/5, 2019 at 15:43
2
Solved
I'm in need of sharing some TypeScript types between my React client and my Express REST API in order to keep the code clean and DRY.
Since this is a private proejct I wouldn't share these types th...
Shorts asked 8/3, 2021 at 11:33
3
I get the following error in this case using TS 3.9 with { compilerOptions: {declaration: true }} in my tsconfig.json:
// a.ts
export const key = 1234
export const obj = {
[key]: 1
};
export defau...
Nadaba asked 23/6, 2020 at 15:27
2
I have created a react typescript project with CRA with the command yarn create react-app my-app --typescript
now I have a module foo installed that does not have any typing not by default, not in...
Creature asked 18/3, 2019 at 22:29
3
Solved
I have installed three@^0.103.0, which has its own type definitions.
In src/global.d.ts of my project I have:
import * as _THREE from 'three'
declare global {
const THREE: typeof _THREE
}
The...
Sew asked 12/5, 2019 at 22:43
1
Solved
In a TypeScript project, I would like to use a third-party library that does not provide type definitions. So I need to come up with my own module declaration. What the module basically exports loo...
Caboose asked 21/7, 2019 at 9:22
1
Solved
What is the official name for the php string type?
Is it 'string' like c#, or 'String' like Java, or either?
I could not find it in http://php.net/manual/en/language.types.string.php
I want to u...
Mascagni asked 13/3, 2019 at 20:37
1
Solved
does somebody know how to "extend" (via declaration merging) the declarations of interfaces, that where declared in a library file from typescript?
In my case i want to extend the interface HTMLCa...
Mariettemarigold asked 1/12, 2018 at 8:8
1
Solved
I am trying add typings for our Javascript files at work while we are in the process of converting to Typescript. However, I can not get the declaration files to be recognized.
Here is my file str...
Berna asked 30/10, 2018 at 23:15
2
Solved
I am going through the Go specification to learn the language, and these points are taken from the spec under Declarations and scope.
Though I am able to understand points 1-4, I am confused on po...
Slough asked 25/9, 2018 at 17:15
1
Solved
I am actually learning golang (from .NET) and there is one thing I don't understand about this language.
Sometimes I find this kind of declaration:
https://github.com/golang/crypto/blob/master/ed2...
Kingfish asked 21/3, 2018 at 9:9
1
Solved
This question applies to each of the following source file organisation strategies:
Tests completely separate
/src
/tests
Tests per feature
/src/feature/
/src/feature/__tests__
Tests per fil...
Pay asked 13/5, 2017 at 0:0
2
Solved
I want to do some integer arithmetic and was checking if SBCL could gain more speed if I provide explicit information about the type of values I use. While I easily could use declare in a defun or ...
Constable asked 21/3, 2017 at 21:1
3
I've always used annotations to declare return type. For example:
/**
* @return SomeClass
*/
public function () { ... }
But now I see there's another way:
public function () : SomeClass { ......
Crock asked 1/12, 2016 at 11:45
2
Solved
This is perhaps a very basic question, but, nevertheless, it does not seem to have been covered on SO.
I recently took up Haskell and up until now type declarations consisted of mostly the followi...
Tatiana asked 29/1, 2015 at 23:20
2
Solved
In C++11 a type specifier includes class specifiers and enum specifiers. (aka class definitions and enumeration definitions)
According to the grammar/syntax - type specifiers can appear in several...
Maladjusted asked 7/1, 2014 at 19:34
1
Solved
(please excuse the horribly contrived example)
What I want to do is specify types in the where-clause:
somemap :: (a -> b) -> [a] -> [b]
somemap f xs = ys
where
some = take 5 xs :: [a]...
Redhanded asked 3/5, 2012 at 15:16
2
Solved
Let us consider the following code snippet:
blah :: a -> b -> a
blah x y = ble x where
ble :: b -> b
ble x = x
This compiles fine under GHC, which essentially means that b from the 3r...
Kin asked 6/12, 2011 at 12:50
2
Solved
I am writing a Delphi 2010 application. It has many files, two of which are called Utils_ABS and Utils_MAT. I have created a record type that both files need to understand, so I put it in its own f...
Nyssa asked 23/10, 2011 at 0:15
1
Solved
There are many ways to declare a new class type:
TMyClass1 = TObject;
TMyClass2 = type TObject;
TMyClass3 = class end;
TMyClass4 = class(TObject);
TMyClass5 = class(TObject) end;
It's my unders...
Broussard asked 23/2, 2011 at 2:39
2
Solved
What is difference between Command$ and Command in VB 6?
MsgBox Command$
MsgBox Command
Fred asked 24/12, 2010 at 15:30
1
© 2022 - 2024 — McMap. All rights reserved.