Questions tagged [interface]
An interface refers to the designated point of interaction with a component. Interfaces are applicable at both the hardware and software level. --- It also refers to the language-element `interface`, which is the sole exception to single-inheritance in Java, C# and similar languages.
interface
20,111
questions
0
votes
1
answer
43
views
Strange behivour with Typescript and arrays [closed]
I'm trying to create a function which uses an array inside an interface to access many connections inside a request body object.
What's strange, is that the property length does not exist on the array ...
0
votes
0
answers
28
views
C++ interface with only one implementation without performance overhead (for mocking in unit tests)
I am making a game engine in C++ and want to start implementing unit tests.
As far as I'm aware, you can only create mocks of pure virtual functions.
However, because I do not want to add needless ...
0
votes
2
answers
75
views
How do I create an interface for a conditional one-to-many relation?
I am creating an inventory app for electronic components. There is a package for each component which will change if their assemble technology is on SMD or DIP. Each SMD and DIP has its own options, ...
2
votes
0
answers
16
views
How can I check if key is part of an interface in typescript? [duplicate]
I have an interface [simplified]
export default interface FormListarAtendimentosDTO {
idArea?: number;
idAssunto?: number;
idMotivo?: number;
order?: string;
page?: number;
...
0
votes
1
answer
54
views
How to a return generic type in go [duplicate]
I'm very new to go, still in the phase of learning and couldn't find any answers matching to my issue, so please don't downvote.
I have this generic interface which can be instantiated by two type ...
0
votes
2
answers
132
views
How do interfaces solve the circle-ellipse problem?
It is sometimes said that interfaces solve several problems of object-oriented programming, in particular the circle-ellipse problem. It would be this interface
class IEllipse {
public:
virtual ...
0
votes
0
answers
12
views
Adding ImageView Dynamically Behind Transparent Areas in Multiple Frames in Android App kotlin
I am developing an app where each frame contains a transparent area where users can place their images. The size and position of this transparent area vary across more than 100 frames, some having 3 ...
-1
votes
0
answers
15
views
How can I fix this error on my NestJs application: Type 'Role' has no properties in common with type 'Role'.ts(2559) (parameter) role: Role
enter image description here
Here is my GitHub code: https://github.com/borisalibeja/EcoFarm
I trying to build auth using RBAC, but I have some problems with the interface declared on the node Modules....
0
votes
0
answers
12
views
Android 12: Unable to use the launcher's built-in call over bluetooth function. How to change the default?
In my car I have a device running Android 12 and I tend to have my phone connected via Bluetooth. When I want to make a call or receive a call while driving it should use the built-in calling ...
-1
votes
2
answers
42
views
How to implement the `From` trait for a generic type, and retrieve the internal generic type?
For example I have below generic struct:
use std::convert::From;
pub struct Rect<T> {
pub top_left: (T, T), // 0 is x, 1 is y.
pub bottom_right: (T, T), // 0 is x, 1 is y.
}
impl<T> ...
0
votes
0
answers
18
views
Cannot import type interfaces of AWS js sdk v3
I am using AWS pinpoint service with typescript. And I want to define return type for GetSegmentCommand's output. The docs says that it is exported as this:
export interface GetSegmentCommandOutput ...
0
votes
0
answers
30
views
Pyside (pyqt) how to control UI through qthread? what is the correct way for my example [duplicate]
I'm creating a program in pyside, where most of the functions will be linked through threads, as they are time-consuming functions. and the interface should work.
but I need to have control of some UI ...
1
vote
1
answer
32
views
Extract Generic Interface or Type keys as an Array [duplicate]
I want to know if it's possible to get a generic interface or type and get it's properties like an array of objects, like this:
interface UserData {
email: string
}
keys = extractKeys<UserData&...
0
votes
0
answers
16
views
academic/scholarly term for Interface belonging to class library(in a dll or jar file) that must be implemented by the client application code
Let's say one has a Financial Foreign Exchange Processor Class Library called ForeignXchangeProc and a client business application that uses said Class Library.
However, within the ForeignXchangeProc, ...
0
votes
2
answers
51
views
Covariance for value in Dictionary
I'm trying to add a more derived type as value to a dictionary<..., base> but i get the following error:
Cannot convert from HandleIntegrationEvent<TR> to HandleIntegrationEvent<...